Be the first user to complete this post
|
Add to List |
Generating container components with connect utility in react redux app
Presentational component specifies look of the component where as Container component specifies how the behavior of it. I would recommend reading Presentation vs container components. In well architected react-redux app, Container components have two major responsibilities:
- Re-render the presentational component when store updates
- Define the behavior of presentational components by passing the necessary data and dispatch callbacks to update the store
Generating containers component without connect from react-redux
[wpgist id="dcb86657def2bd9390a170b8a4f17092" file="container-component-without-connect.js"]Generating containers component with connect from react-redux
- In this approach, the container components do not need to access the redux store via context. Hence, they do not need to specify the contextType explicitly.
Also Read:
- Use es6 and es6+ in eslint with babel
- Redux: Implementing store from scratch
- webpack with babel6 and react
- Pass down props using React childContextTypes in a deeply nested component tree
- Redux: Implementing store from scratch