Summary
In this chapter, we started to craft a new thing called a state inside the function component. The state is persistent across updates and can be used to request a new update, listen to a value change, as well as perform a task at the mount. Later, we applied the state we developed to a single-page application to draft a simplified Nav
with a route system. In the end, we briefly studied how states work for UI under React.
In the next chapter, we will introduce you to what a React hook is and how this persistent state is designed under the React engine.