Last updated
Last updated
tss-react
unlike jss-react
doesn't support the $
syntax but is a better alternative.
In JSS you can do:
This is how you would achieve the same result with tss-react
Another example:
withStyles
NOTE: This does not apply to the Modern API, only for makeStyles and withStyles
In SSR setups, on stylesheets using nested selectors, you could end up with warnings like:
Warning: Prop className did not match. Server: "tss-XXX-root-ref" Client: "tss-YYY-root-ref"
.
You can fix this error by providing a unique id when calling makeStyles
or withStyles
(It will set XXX and YYY).
withStyles:
WARNING: Nested selectors requires support which .
It can't be polyfilled ( will not work) but don't worry, if Proxy
is not available on a particular browser, no error will be thrown and TSS will still do its work.
Only nested selectors won't work.
Short unique identifiers can be generated with .