How can I return a react component using withStyles?
danvc opened this issue · 2 comments
danvc commented
Hi everyone.
The question here is not about how to export, but, how to return a React object with the css injected?
I'm trying to achieve something like it:
return ( withStyles(this.props.style)(<Component {...params}/>) );
Where the intention is to return Component with all CSS set using withStyles
and with its styles injected in the property called style
.
ljharb commented
That snippet needs a slight tweak - withStyles takes a component, not an element.