Module 2
Working With State
In the early days of the web, websites were essentially fancy documents. We'd load one HTML file, read the content, and then load another one.
The beautiful, amazing, magical thing about the modern web is that web applications are interactive. The app can respond to user actions in real-time, without needing to fetch a whole new page.
React has a really novel approach towards managing this interactivity. And once you get used to it, it's really hard to imagine managing it any other way.
In this module, we'll learn about:
- How to respond to user actions with event binding.
- How React manages the DOM for us, and what it actually means to "re-render".
- The
useState
hook, and how to use it to build interactive components. - Understanding the difference between props and state.
- Working with forms in React (everyone's favourite topic!).
- Working with complex state, like objects and arrays.
- Avoiding common pitfalls (eg. bugs related to state mutation).
- How to share state across the application by lifting it up.
This is a really exciting module, because we go from static websites to dynamic, alive applications. Let's do this!