Forked from sseletskyy/react-redux-container-template.js
Created
July 20, 2018 11:47
-
-
Save nick-kravchenko/6f6c3061648b3bf14c09978b64295cfc to your computer and use it in GitHub Desktop.
React Redux Container Component Webstorm/PHPStorm File Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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