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 ...