question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[react-jss] compiled class name does not prefix with Component name

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kofcommented, Mar 14, 2020

Using hooks?

0reactions
kofcommented, Mar 18, 2020

It’s not too hard, babel plugin can take the component name and pass it as an argument to useStyles hook call.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSSProvider not generating class prefix with classNamePrefix
Im trying to generate unique class names for the micro-frontend, something like App1-{className} using JssProvider classNamePrefix prop, but ...
Read more >
JSS integration with React
You can add an additional prefix to each class, see here. You can minify class names by passing id prop, so that prefixes...
Read more >
JSS integration with React
React-JSS wraps your component with a higher-order component. It injects a classes prop, which is a simple map of rule names and generated...
Read more >
Why I left CSS-in-JS and returned to good old CSS ...
Let's look at some popular options. 3.1. CSS modules. CSS modules also generate class names, but, unlike JSS, they do it in compile...
Read more >
Styles API - MUI System
@mui/styles is not compatible with React. ... class name generator : The generator should be provided to JSS. ... It will be linked...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found