Skip to content

Instantly share code, notes, and snippets.

@EhsanZ
Last active October 18, 2017 12:27
Show Gist options
  • Save EhsanZ/a8fe49f3f366eee30526c9bc33e0fff5 to your computer and use it in GitHub Desktop.
Save EhsanZ/a8fe49f3f366eee30526c9bc33e0fff5 to your computer and use it in GitHub Desktop.
React / Redux File Templates For JetBrain IDEs
import React, {PropTypes} from 'react'
class $NAME extends React.Component {
render() {
return(<h1> $NAME </h1>)
}
}
$NAME .PropTypes = {
// myProp: PropTypes.string.isRequired
}
export default $NAME
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { bindActionCreators } from 'redux'
// import * as actions from 'file.actions'
class $NAME extends Component {
render() {
return (<h1> $NAME </h1>)
}
componentDidMount(){
// this.props.actions.fetch()
}
}
const mapStateToProps = (state) => {
return {
state: state
}
}
const mapDispatchToProps = (dispatch) => {
return {
// actions: bindActionCreators(actions, dispatch)
};
}
const container = connect(mapStateToProps, mapDispatchToProps)($NAME)
export default withRouter(container)
import React, { PropTypes } from 'react'
import { generateReactKey } from 'utils/utils'
const $NAME = ({props}) => {
return (<h1 key={generateReactKey()}> $NAME </h1>)
}
$NAME .PropTypes = {
// props: PropTypes.string.isRequired
}
export default $NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment