This is a basic hands-on exericse intended to familiarize users with the Redux in React apps.
To get started,
- Clone the repo: git clone https://github.com/GautamSatish/react_redux_demo.git
- Install the dependencies: npm install
- Start the webpack dev server: npm run dev
This should launch your app at http://localhost:9000/
The app implements a simple counter with one button to increment and another to decrement the counter value. This is implemented using the React state. The exercise is to use Redux to accomplish the same.
What you need to do:
- Complete the action creator function implementation in src/actions.js.
- Complete the reducer function in src/reducers.js.
- Create store and pass it to the Provider wrapper component in src/index.js.
- Implement the mapStateToProps and mapDispatchToProps functions, update the App component and connect the wrapper component in src/App.jsx.
A sample solution is present on the branch sample_solution
.