Let's learn about the useContext hook together in React.
We start with an overview of the useContext hook and the steps we need to take to setup a Context Provider boundary as well as provide it a value to all children components.
Then, we look at how we can consume this context inside any children no matter how deep in the tree of the Context Provider.
We wrap up the video by looking at how useContext can be used in conjunction with useState to manage state for multiple components in a parent component.
Chapters:
00:00 Introduction
01:15 useContext Overview
02:40 Steps to create Context
04:00 Component Setup
07:26 Creating a Context Object
10:05 Creating a Value Prop
14:01 Creating a Context Provider
18:54 Consuming Context - useContext Hook
26:40 Manipulating Context Without State
31:09 Visualizing Context
35:07 Stateful Context with useState
47:52 Recap and Next Steps
📦 Github Repository with the notes and exercise code+solutions: https://github.com/Nooder/react-in-depth
💬 Come join us on Discord to chat with a like-minded community about tech and learning: / discord
🏅Support the channel and content through Super Thanks, Channel Memberships, or on Patreon: / techwithnader
On this page of the site you can watch the video online useContext Hook - React In Depth with a duration of hours minute second in good quality, which was uploaded by the user Tech with Nader 25 August 2023, share the link with friends and acquaintances, this video has already been watched 2,122 times on youtube and it was liked by 98 viewers. Enjoy your viewing!