Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JohnTendik/bc8fc6bfc2831f52bbc33e1395512fe9 to your computer and use it in GitHub Desktop.
Save JohnTendik/bc8fc6bfc2831f52bbc33e1395512fe9 to your computer and use it in GitHub Desktop.
{
"Connected stateless component": {
"prefix": "cscomp",
"body": [
"import React from 'react';",
"import PropTypes from 'prop-types';",
"import { connect } from 'react-redux';",
"",
"const MyComponent = () => {",
"\treturn ();",
"};",
"",
"MyComponent.propTypes = {",
"",
"};",
"",
"const mapStateToProps = (state) => {",
"\tconst { general } = state;",
"\treturn {",
"",
"\t};",
"};",
"const mapDispatchToProps = (dispatch) => {",
"\treturn {",
"",
"\t};",
"};",
"",
"export default connect(mapStateToProps,mapDispatchToProps)(MyComponent);",
""
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment