Managing State with React Hooks
Chapter 2, Getting Started with React, was a great way to kick off React frontend development. By now, you should be familiar with project directory structures and a few other concepts in React. In this chapter, we will take your understanding of React’s core concepts further.
Why does this matter? Simple. You can’t be the shining light you intend to be with React development without getting a grounding in the React core features and how we use them. This chapter focuses on managing state with React Hooks.
State in React is the medium through which we add interactivity to the user interface. Before React v16.8, developing class components was the only way you could add state and state transitions to your components.
Functional components were stateless; they were only able to display JavaScript XML (JSX) elements, that is, presentational components only. But with the Hooks API, you can add state and state transitions to your functional...