2016-09-26 95 views
2

到目前为止,我一直在使用终极版“连接”到组件与状态连接,导出我的部件通过以下方式“连接”使用反应-CSS-模块,但我必须使用以下出口中的每个组件做到这一点:使用从终极版与反应,CSS模块

export default CSSModules(ComponentTitle, styles); 

我如何导出组件有两种功能?

谢谢:)

回答

3

你可以用你的反应组分与CSS功能前,连接到终极版。

const ComponentWithCSS = CSSModules(ComponentTitle, styles); 
export default connect(mapStateToProps, actions)(ComponentWithCSS);