On my journey to master Redux+React I went on to create a very simple Redux app.
Get the code here – https://github.com/arcofdescent/react-starter
This repo can be used both as a starter kit for developing Redux+React apps as well as a helpful guide to those wishing to see some simple code (I hope) in action.
Here’s a screen shot of the app
We use a very simple store containing two counters. The first counter
increments/decrements by 1. The second counter increments/decrements by 2. We also have a Messenger component which sends messages to the first counter.
In all there are three components all as children of the main App component.
App is a container which is aware of Redux. The three child components below it are not. They act as dumb components which simply update their views based on change in state.
I also hope you understand and appreciate the organization of the source tree.
actions, components, containers, reducers go into their own directories. All styles use SASS.
Global style is defined in styles/app.scss
Component specific style is in the related component’s directory.
I’m using webpack to bundle all this stuff.
If you want to run this app:
* Download this repo (or clone it)
* cd into it
* npm install (assuming you already have node installed)
* npm run test (a very simple test)
* npm run start
* In your browser – http://localhost:8080