Book about React Hooks
-
Whether it’s fully server-rendered, a mobile app, or all in a browser, your application’s user interface should represent the current data, or state, at the time of rendering.
-
2.1. Setting up the bookings manager app.
- Create the project.
npx create-react-app react-hooks-in-action
,
- install react Router.
npm i history react-router-dom@next
- Creating Components.
- Create the project.
-
2.2 Storing, using, and setting values with useState. - Asking React to manage component state values by calling useState
- Calling useState returns a value and its updater function in an array with two elements. - When users sets the value with useState react runs the component again and generate the update UI. - Changing state values and triggering re-renders with an updater function - Using the previous state to help generate new state values -
Managing multiple pieces of state
-
Considering how React and components interact to persist and update state and synchronize state and UI
- Repository with the code of the book https://github.com/jrlarsen/react-hooks-in-action.