Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sseletskyy/7526fa8ec6afbd665c882ebd5cbe6d8b to your computer and use it in GitHub Desktop.
Save sseletskyy/7526fa8ec6afbd665c882ebd5cbe6d8b to your computer and use it in GitHub Desktop.
React Redux Container Component Webstorm/PHPStorm File Template
import React, { PropTypes, Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
// Import actions here!!
class $NAME extends 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