DEV Community

Discussion on: Setting up Redux store in Your React application

Collapse
 
markerikson profile image
Mark Erikson

Hi, I'm a Redux maintainer. As an FYI, we now recommend several newer patterns than what's shown in this post. In particular, you should be using our official Redux Toolkit package to set up the store and write your Redux logic, and we recommend using a "feature folder" structure with "slice" files for logic rather than splitting files across multiple folders.

I strongly recommend reading through the new newly rewritten official tutorials in the Redux docs, which have been specifically designed to teach you how Redux works and show modern practices:

  • "Redux Essentials" tutorial: teaches "how to use Redux, the right way", by building a real-world app using Redux Toolkit
  • "Redux Fundamentals" tutorial: teaches "how Redux works, from the bottom up", by showing how to write Redux code by hand and why standard usage patterns exist, and how Redux Toolkit simplifies those patterns

The older patterns shown in almost all other tutorials on the internet are still valid, but not how we recommend writing Redux code today.

You should also read through the Redux "Style Guide" docs page, which explains our recommended patterns and best practices. Following those will result in better and more maintainable Redux apps.

In addition, the easiest way to start a new project is with the official Redux+JS template for Create-React-App. It comes with Redux Toolkit and the React-Redux hooks API already set up when the project is created.