isomorphic-style-loader icon indicating copy to clipboard operation
isomorphic-style-loader copied to clipboard

Can't use isomorphic-style-loader with functional Components?

Open daiict218 opened this issue 8 years ago • 1 comments

Hi, I'm using isomorphic-style-loader in my application and now I tried using a functional component with it but it returns me a React class component. So, later in my app (in some component which expects a functional component to render), react throws me an error saying that it expected a functional component and got a class. Is there any way where I can use withStyles on functional components? Thanks


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

daiict218 avatar Mar 24 '17 15:03 daiict218

Yes, Higher order components work with functional components. It shouldn't be an issue. you need to export withStyles(styles)(ComponentName)

davidfurlong avatar Oct 11 '17 22:10 davidfurlong