redux
react-redux
actions.js
- action constants and your action creator functionsreducers.js
(or a folder) - import your actions and define reducer functionsCounterApp.js
- define the store so that the React app can use it
components/
- holds all your dumb components- they know nothing about redux
- they accept props!
- show the props
- use props as event handlers
containers/
- holds all your smart containers- they know all about redux!
- have access to redux
state
- can call the store's
dispatch()
- have access to redux
- 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