File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 11function generateReduxConnect ( COMPONENT_NAME ) {
2- return `import template from './${ COMPONENT_NAME } .js'
3- import { connect } from 'react-redux';
2+ return `import ${ COMPONENT_NAME } from './${ COMPONENT_NAME } .js'
3+ import { connect } from 'react-redux'
44
55const mapDispatchToProps = (dispatch, ownProps) => {
66 return {}
77}
88
99const mapStateToProps = (state, ownProps) => {
1010 return {};
11- };
11+ }
1212
13- const ${ COMPONENT_NAME } = connect(
13+ export default connect(
1414 mapStateToProps,
1515 mapDispatchToProps,
16- )(${ COMPONENT_NAME } );
17-
18- export default ${ COMPONENT_NAME } `
16+ )(${ COMPONENT_NAME } )
17+ `
1918}
2019
2120function generateIndexFile ( COMPONENT_NAME , connected ) {
2221 if ( connected ) {
2322 return generateReduxConnect ( COMPONENT_NAME )
2423 }
2524
26- return `import template from './${ COMPONENT_NAME } .js';
25+ return `import template from './${ COMPONENT_NAME } .js'
2726
28- const ${ COMPONENT_NAME } = template;
27+ const ${ COMPONENT_NAME } = template
2928
3029export default ${ COMPONENT_NAME }
3130`
You can’t perform that action at this time.
0 commit comments