cca-io / rescript-mui

ReScript bindings for MUI
MIT License
255 stars 52 forks source link

How can I annotate the classes record from useStyles hook? #113

Closed studious closed 4 years ago

studious commented 4 years ago

My project has a few functions that take the classes record as a parameter and since moving to the makeStyles notation and useStyles hook I am getting errors about record field not found.

How can I type this given the record is generated by the ppx?

Thanks

studious commented 4 years ago

I think I might have finally spotted something in your tests that helped.

module MyStyle = [%makeStyles({....})];

MyStyle.classes seems to do the trick.

jsiebern commented 4 years ago

Glad you've solved it. Let me know if you need further help with this 😃