Closed rianbrob closed 4 years ago
Using hooks?
yes, with hooks...even tried with a new plain vanilla create-react-app to make sure I wasn't nuts. alas, got the same issue even after I implemented a basic App exactly as in https://cssinjs.org/react-jss/?v=v10.0.4#basic
So you didn't just upgrade, you rewrote from hocs to hooks ... hooks have no way to know the components name. To get this, we need to create a babel plugin that does it. Let me know if you wan to work on it. Closing this issue, it needs a new one.
makes sense thanks. though, I was wondering what sort of voodoo would allow knowing the components name using hooks...might want to have the documentation i referred to updated...
It's not too hard, babel plugin can take the component name and pass it as an argument to useStyles hook call.
Describe the bug: upgraded from 8.6.1 to 10.0.4 and now component name is not prefixed in the generated classname.
e.g. instead of
<button class="Button-myButton-1-25">
as per documentation, I only get<button class="myButton-1-25">
.having the component name prefixed in development mode is one of the reasons i love react-jss as it makes it so simple to know where to find something in the code.
Versions (please complete the following information): 10.0.4 of react-jss