Skip to content

Instantly share code, notes, and snippets.

@LuisRBarreras
Last active May 6, 2017 00:06
Show Gist options
  • Save LuisRBarreras/b22171f05dbcd8f0f7611276a442e85e to your computer and use it in GitHub Desktop.
Save LuisRBarreras/b22171f05dbcd8f0f7611276a442e85e to your computer and use it in GitHub Desktop.
React Redux Container Component Template
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
class ${NAME} extends React.Component {
constructor(props, context) {
super(props, context);
}
render() {
return (
);
}
}
${NAME}.propTypes = {
//myProp: PropTypes.string.isRequired
};
function mapStateToProps(state, ownProps) {
return {
state:state
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators(actions, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(${NAME})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment