Book description
React Hooks in Action teaches you to write fast and reusable React components using Hooks. You’ll start by learning to create component code with Hooks. Next, you’ll implement a resource booking application that demonstrates managing local state, application state, and side effects like fetching data. Code samples and illustrations make learning Hooks easy.Table of contents
- React Hooks in Action
- Copyright
- dedication
- contents
- front matter
- Part 1
- 1 React is evolving
-
2 Managing component state with the useState hook
- 2.1 Setting up the bookings manager app
-
2.2 Storing, using, and setting values with useState
- 2.2.1 Assigning new values to variables doesn’t update the UI
- 2.2.2 Calling useState returns a value and an updater function
- 2.2.3 Calling the updater function replaces the previous state value
- 2.2.4 Passing a function to useState as the initial value
- 2.2.5 Using the previous state when setting the new state
- 2.3 Calling useState multiple times to work with multiple values
- 2.4 Reviewing some function component concepts
- Summary
- 3 Managing component state with the useReducer hook
-
4 Working with side effects
-
4.1 Exploring the useEffect API with simple examples
- 4.1.1 Running side effects after every render
- 4.1.2 Running an effect only when a component mounts
- 4.1.3 Cleaning up side effects by returning a function
- 4.1.4 Controlling when an effect runs by specifying dependencies
- 4.1.5 Summarizing the ways to call the useEffect hook
- 4.1.6 Calling useLayoutEffect to run an effect before the browser repaints
- 4.2 Fetching data
- 4.3 Fetching data for the BookablesList component
- Summary
-
4.1 Exploring the useEffect API with simple examples
- 5 Managing component state with the useRef hook
- 6 Managing application state
- 7 Managing performance with useMemo
- 8 Managing state with the Context API
- 9 Creating your own hooks
- 10 Using third-party hooks
- Part 2
- 11 Code splitting with Suspense
- 12 Integrating data fetching with Suspense
- 13 Experimenting with useTransition, useDeferredValue, and SuspenseList
- index
Product information
- Title: React Hooks in Action
- Author(s):
- Release date: April 2021
- Publisher(s): Manning Publications
- ISBN: 9781617297632
You might also like
book
Tidy First?
Messy code is a nuisance. "Tidying" code, to make it more readable, requires breaking it up …
book
The Staff Engineer's Path
For years, companies have rewarded their most effective engineers with management positions. But treating management as …
book
Modern Software Engineering: Doing What Works to Build Better Software Faster
Improve Your Creativity, Effectiveness, and Ultimately, Your Code In Modern Software Engineering, continuous delivery pioneer David …
book
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …