DORRITO
DORRITO

Reputation: 661

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?

Upvotes: 2

Views: 712

Answers (1)

Jules Dupont
Jules Dupont

Reputation: 7567

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.

Upvotes: 2

Related Questions