Online Example
If we add new rule with just function values, .update() does not work for this new rule:
const styles = {
title: {
fontSize: 20,
color: ({color}) => color
}
}
const sheet = jss.createStyleSheet(styles, {link: true}).attach()
sheet.addRule('subtitle', {color: ({color}) => color})
sheet.update({color: 'red'}) // still no color for subtitle, with attach() then too
// but if we call .deploy() - color applies
But this works:
const sheet2 = jss.createStyleSheet(styles, {link: true}).attach()
sheet2.detach()
sheet2.addRule('subtitle', {color: ({color}) => color})
sheet2.update({color: 'red'}).attach() // red color for subtitle too
Online Example
If we add new rule with just function values,
.update()does not work for this new rule:But this works: