- Create the context using the createContext method.
- Create the Provider component with the values to pass as the state. In our case the Library State component.
- Create reducers to manipulate state and attach with the state using useReducer hook.
- Wrap the component where value is to be accessed inside the Provider component.
- Access values using the useContext hook.