Prop drilling in React can be nightmare at times, useContext comes our rescue and allows us to access state from anywhere in the hierarchy.
By creating a Context and wrapping our top level component in this context with context.provider we can set the 'value' on this component to be our state.
Then in lower level components we simply import the Context and call useContext to retrieve the same state which can then be used.
Nesta página do site você pode assistir ao vídeo on-line React UseContext duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário A shot of code 15 Agosto 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,503 vezes e gostou 148 espectadores. Boa visualização!