In this video, Emmanuel Henri demonstrates how to implement the code for updating a nested component with the context.
- Alright, so now that we have created a new provider here … with this.state and we created a function … that will be able to leverage in NewSingle. … Let's go ahead and update our NewSingle. … So right now if we leave it as is, … it's not going to work because we're passing … first name and last name … which is not available from our provider. … So if we switch back to our application here … and refresh, we should have some issues here. … So we're not having anything on the name here. … We don't have access to first name and last name now. … So if we bring the console as well … we have some issues here. … So, we also, if we go back to react. … So if you don't have this plugin … I would strongly recommend that you install … the react developer tool because right now … we can take a look at what our state looks like … and as we click on toggle name … we're going to see how our state is being impacted by this. … Alright, so now let's go ahead and change … a few things in our consumer. …
- Creating a context object
- Implementing the code for updating context
- Updating context from a nested component
- What to avoid when working with context
- How the node tree in React applies to context
- Consuming multiple contexts