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.
On this page of the site you can watch the video online React UseContext with a duration of hours minute second in good quality, which was uploaded by the user A shot of code 15 August 2022, share the link with friends and acquaintances, this video has already been watched 3,503 times on youtube and it was liked by 148 viewers. Enjoy your viewing!