Created
March 3, 2019 21:39
-
-
Save JohnTendik/bc8fc6bfc2831f52bbc33e1395512fe9 to your computer and use it in GitHub Desktop.
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
{ | |
"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