Managing Data

Proper data fetching goes through some of the most common patterns to make a child and parent communicate using callbacks. We'll learn how we can use a common parent to share data across components that are not directly connected. We will then start learning about the new React Context API and React Suspense.

We will cover the following topics in this chapter:

  • React Context API
  • How to consume a context with useContext
  • How to use React Suspense with SWR

Technical requirements

To complete this chapter, you will need the following:

  • Node.js 12+
  • Visual Studio Code

You can find the code for this chapter in the book's GitHub repository: https://github.com/PacktPublishing/React-17-Design-Patterns-and-Best-Practices-Third-Edition/tree/main/Chapter06 ...

Get React 17 Design Patterns and Best Practices - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.