It is easy and fast to learn how a design pattern works by implementing a todo list.
Here we implement a todo list using Redux architecture.
(Click the above title link to see demo)
|-- todomvc
|-- .babelrc # Babel configuration file, makes us able to write es6 syntax
|-- README.md # Ignore it
|-- package.json # Node package configuration
|-- webpack.config.js # Webpack configuration file
|-- app # App src code
| |-- index.js # Entry point of app, config in webpack.config.js
| |-- __tests__ # Jest unit test
| |-- actions # Redux actions
| |-- components # React dumb component
| |-- containers # React smart component, composed by dumb component
| |-- reducers # Redux reducers
| |-- store # Redux store
|-- build # Webpack build/deploy output folder
|-- bundle.js # You can change output file name in webpack.config.js
|-- index.html # After build or deploy, you can open this file to see demo
|-- style.css # You can change output file name in webpack.config.js
First open your command line, clone this project (suppose you have installed git command line tool) or simply download the ZIP to your prefered directory .
git clone https://github.com/HowardLoTW/react-redux-sample.git
cd react-redux-sample/todomvc
Suppose you have installed nodejs (required node version 4.x or upper. I'm using node v5.3.0 & npm v3.3.12).
Type 'npm install' in your command line to install dependencies.
npm install
npm run dev
Open your browser and navigate to http://localhost:8080/webpack-dev-server/
npm run test
npm run build
npm run deploy
In this project, I use the following css tools and it works well with React. And of course you can use another css tools to write css in your project.
You can checkout the following talks for more information:
- The case for CSS modules - Mark Dalgleish
- Michael Chan - Inline Styles: themes, media queries, contexts, & when it's best to use CSS
- CSS with React.js
- More setup workflow information, please refer to react-webpack-cookbook
- Learn to implement Redux architecture in React app
- More Redux example