I\'m beginner of react development with redux. I\'m wondering what are the Presentational Components and Container Components.
Here is the summarized version of the differences inorder to understand easily, even though some of them are related to the above answer above,
Container Components
Example :
class TodoApp extends Component {
componentDidMount() {
this.props.actions.getTodos();
}
render() {
const { todos, actions } = this.props;
return (
);
}
}
function mapState(state) {
return {
todos: state.todos
};
}
function mapDispatch(dispatch) {
return {
actions: bindActionCreators(TodoActions, dispatch)
};
}
export default connect(mapState, mapDispatch)(TodoApp);
Presentation Components
Example: