Introduction to Redux Toolkit
People complain that there is too much boilerplate when setting up Redux. Or, they have a lot of questions as to how to structure your Redux store. Ultimately, this flexibility is probably good for complicated use cases, but having there is also a place for having some sensible defaults.
In this section, we'll create an example using a template for Create React App. We'll take a tour of everything going on and then we'll build our own application to see it in action.
You can generate a React application using the Redux Toolkit template by doing the following in the command line:
npx create-react-app cra-redux-counter --template=redux
Let's take a tour of this application and see what we can learn just from looking at the code.