You’ve been using React’s Context API to manage global state to share the same information across multiple components. Redux, like Context, gives you a way to store and manage global state in your React applications. Even though Context has become a popular option since its introduction, Redux remains a popular option for projects with sophisticated global state requirements.
After reading and practicing how to use Redux, you should be able to:
createStore
method to create an instance of a Redux storestore.dispatch
method to dispatch an action to trigger a state updatestore.subscribe
method to listen for state updatesstore.getState
method to get the current stateswitch
statement within a reducer function to handle multiple action types