Skip to content

Commit c2433f8

Browse files
committed
fixed indexes templates imports and exports
1 parent d88c513 commit c2433f8

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/templates/js/index.template.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
function 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
55
const mapDispatchToProps = (dispatch, ownProps) => {
66
return {}
77
}
88
99
const 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

2120
function 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
3029
export default ${COMPONENT_NAME}
3130
`

0 commit comments

Comments
 (0)