Context in React. useContext and nested Context.Provider

Publicado el: 22 abril 2023
en el canal de: senior_zone
6,386
260

Let's explore what prop drilling is and how to fix it, learn how context works in React, and how to avoid unnecessary rerenders when using it.

Code from the lesson - https://github.com/senior-frontend/us...

Telegram - https://t.me/snr_fullstack

00:00 - Announcement of the last topic in the React Hooks series
00:33 - Prop Drilling
00:52 - Getting to know the example code without using context
02:39 - Why Prop Drilling is bad
04:09 - The differences between the approaches are illustrated in pictures
04:55 - Creating a context and provider, a little about defaultValue
07:55 - useContext instead of Prop Drilling
11:13 - Specifics of accessing the provider, more about defaultValue
14:06 - Why the Context API can't replace the state manager out of the box
15:39 - Context separation, MasterProvider
17:24 - Code review of the final example
18:00 - Performance differences in the final example with separated contexts Context
19:13 - Summary

GitHub Issues on context rerendering:
1. https://github.com/facebook/react/iss...
2. https://github.com/facebook/react/iss...


En esta página del sitio puede ver el video en línea Context in React. useContext and nested Context.Provider de Duración hora minuto segunda en buena calidad , que subió el usuario senior_zone 22 abril 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 6,386 veces y le gustó 260 a los espectadores. Disfruta viendo!