useContext is a great way to pass props from a global state to all its children components in React. It eliminates 'prop drilling', which can be messy and frustrating, especially with deeply-nested components.
To use useContext, we need to create a context object
We define the context using the createContext() method
We set up the UserProvider component to manage the user state and provide it to the child components using the useContext hook.