useContext
could be used to maintain a
global copy of the data that all the components can share.
This provides a cleaner way to share data between components.
One of the common use cases is tracking the currently logged in user details.Instead of passing the same logged status to every component that uses it we can just write can make use of the Context concept to create a clean code.Or designing a theme for a website.
Let's start off with a simple example of using Context concept