Skip to content

Instantly share code, notes, and snippets.

@jurosh
Last active June 9, 2016 12:14
Show Gist options
  • Save jurosh/087120a6053317704ddd2aa22f72b83b to your computer and use it in GitHub Desktop.
Save jurosh/087120a6053317704ddd2aa22f72b83b to your computer and use it in GitHub Desktop.
React stateless component
// --- comps ---
import React from '"react"';
const $component$ = () => (
<div>
$END$
</div>
);
export default $component$;
// --- compsprops
import React, {PropTypes} from '"react"';
const $component$ = () => (
<div>
$END$
</div>
);
$component$.propTypes = {
example: PropTypes.any
};
export default $component$;
// --- compc
import React, {PropTypes} from '"react"';
import {connect} from '"react-redux"';
// import * as actions from 'actions/actionTypes';
@connect((state) => ({
example: state.example
}))
export default class $container$ extends React.Component {
static propTypes = {
dispatch: PropTypes.func,
example: PropTypes.any
};
componentDidMount () {
// this.props.dispatch(getCompetitionsByDate());
}
render () {
// const {something} = this.props.example;
return (
<div>
$END$
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment