📜  cra redux - Javascript (1)

📅  最后修改于: 2023-12-03 15:14:16.772000             🧑  作者: Mango

CRA Redux - Javascript

CRA Redux is a boilerplate project created using Create React App (CRA) and Redux. It provides a solid foundation for building scalable and maintainable React applications.

Features
  • Uses Create React App, the most popular React project starter.
  • Includes Redux, a predictable state container for JavaScript apps.
  • Configured with Redux Toolkit, a powerful toolset for efficient Redux development.
  • Implements the popular Ducks pattern for Redux file organization.
  • Includes Redux DevTools Extension for easy state debugging.
  • Uses React Router for handling client-side routing.
  • Configured with ESLint and Prettier for code consistency and formatting.
Getting Started

To start using CRA Redux, follow these steps:

  1. Clone the repository using git clone https://github.com/username/cra-redux.git.
  2. Install the dependencies using npm install.
  3. Start the development server using npm start.
File Structure

The file structure of CRA Redux follows the Ducks pattern for Redux file organization. Each feature has its own folder containing its action types, actions, reducer, and selectors.

src/
├── app/
│   ├── App.js
│   ├── App.test.js
│   ├── index.js
│   └── store.js
├── counter/
│   ├── actions.js
│   ├── actionTypes.js
│   ├── reducer.js
│   └── selectors.js
├── todos/
│   ├── actions.js
│   ├── actionTypes.js
│   ├── reducer.js
│   └── selectors.js
├── index.js
└── router/
    ├── Router.js
    └── routes.js
Available Scripts

In the project directory, you can run:

npm start

Runs the app in development mode. Open http://localhost:3000 to view it in the browser.

npm test

Launches the test runner in the interactive watch mode.

npm run build

Builds the app for production to the build folder.

Conclusion

CRA Redux is a great starting point for building React applications with Redux. It provides a solid architecture and toolset for building maintainable and scalable apps. Try it out today and let us know what you think!