cca-io / rescript-mui

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

Runtime issues with the example #122

Closed dodomorandi closed 3 years ago

dodomorandi commented 3 years ago

After the migration to rescript-react has been merged, @jsiebern noticed a problem with the example.

I am opening an issue mainly to discuss what is happening, what could be involved and, in case, how this could be fixed.


Using the debugger, it is possible to see that module @material-ui/styles/esm/useTheme/useTheme.js imports ThemeContext from './ThemeContext'. However this is undefined, causing the hook error inside useTheme. This function is called from useStyles, which, if I am not wrong, is called from AppLayout.res:15.

What I don't get is the fact that ThemeContext.js exists inside @material-ui/styles/esm/useTheme. This makes me think that the issue could be related to some strange behavior of webpacking...? Let me know what you think.

cknitt commented 3 years ago

Just built version 2.1.0 together with @jsiebern, and we did not encounter any problem with the examples.

dodomorandi commented 3 years ago

Fantastic!!! I just finished checking, and I did not encounter the issue anymore as well. Probably you fixed the issue during the refactory you made since I opened the issue.

Thank you for your awesome work!