Skip to content

Instantly share code, notes, and snippets.

@rachsmithcodes
Last active June 15, 2017 23:28
Show Gist options
  • Save rachsmithcodes/da06729482d8fe16da4e22ccbabe54bf to your computer and use it in GitHub Desktop.
Save rachsmithcodes/da06729482d8fe16da4e22ccbabe54bf to your computer and use it in GitHub Desktop.
New Container Component VSCode User Snippet
"New Container Component": {
"prefix": "ncc",
"body": [
"import { connect } from 'react-redux';",
"import ${1:name} from './${1:name}';",
"",
"const mapStateToProps = state => {",
" return {$2};",
"};",
"",
"const mapDispatchToProps = dispatch => {",
" return {$3};",
"};",
"",
"const ${1:name}Container = connect(mapStateToProps, mapDispatchToProps)(${1:name});",
"export default ${1:name}Container;"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment