npm install redux
npm install react-dedux
actions.js
- actions constants and your action creator functionsreducers.js
(or a folder) - import your actions and define reducer functions- 'CounterApp.js` - define the store so that the React app can use it
components/
- holds all your dumb components- They know nothing about Redux
- The accept props
- What do React Components do to props?
- show the props
- use props as event handlers
- What do React Components do to props?
containers/
- holds all your smart containers- They know all about Redux
- have access to redux state
- can call the store's dispatch
- They don't know about React
- they import your dumb components
- They wire together your dumb components and redux's
state
anddispatch
- define
mapStateToProps
function - define
mapDispatchToProps
function
- define