Add filename keys to your jss-simple declarations to help with hot reloading
$ npm install babel-plugin-jss-simple
It transforms this:
import css from 'jss-simple'
const style = css({
primary: {
color: 'green'
}
})
into this:
import css from 'jss-simple'
const style = css({
primary: {
color: 'green'
}
}, __filename)
If you are using hot module replacement on the client, you won't be able to tell which styles are the new styles. This provides a key (the filename) to jss-simple so that it can replace the previous style with the new style, and your stylesheet doesn't grow huge.
No. It will track whatever you've called your default import and rewrite it appropriately.
Yes. Each instance of the call will be keyed separately, with _<n>
being suffixed to the file name key.
MIT