简体   繁体   中英

Using Material-ui custom theme with redux

I have Material-ui and redux all set up in and working, however redux has you use connect with higher order components:

export default connect(mapStateToProps)(ComponentName);

while the Material-ui documentation has you do something similar:

export default muiThemeable()(ComponentName);

How would you combine the theme with the redux export to get them to export or work together?

You can compose multiple Higher Order Components :

export default muiThemeable()(connect(mapStateToProps)(ComponentName));

An HOC takes a component (and possibly other arguments) and returns another component. So, the return value of an HOC is a valid argument for another HOC.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM