What You Learned

You can use Redux instead of the built-in setState if you need a lot of flexibility or if you need to pass the same data to many far-apart components. With Redux, deeply nested or far-apart elements can affect the application state without passing props down many layers of elements.

Redux places the state in a single object called the store. You generate state changes by creating action objects and sending them to the store. React Redux wraps plain presentational components into higher-order components that talk to the store. You can use it both on custom components and to connect existing components to the store.

Redux is a toolkit. You’ve seen one of the most common ways to use it with React. Middleware can modify Redux behavior ...

Get React for Real now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.