You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of lazily creating the defaultSheet on set of a rule, create it on construction of jss. I ran across very confusing behavior when I was trying to interact with two different stylesheets using jss. Example:
var jss1 = jss.forDocument(document)
var jss2 = jss.forDocument(document)
jss2.set('#A', {
color: 'green'
})
jss1.set('#A', {
color: 'red'
})
I expected element #A to be green after both rules were set, but in fact, the element changes to red. The reason is that the stylesheet is created on the first set instead of on forDocument. It would be much cleaner to create the sheet on construction.
The text was updated successfully, but these errors were encountered:
Instead of lazily creating the defaultSheet on set of a rule, create it on construction of jss. I ran across very confusing behavior when I was trying to interact with two different stylesheets using jss. Example:
I expected element #A to be green after both rules were set, but in fact, the element changes to red. The reason is that the stylesheet is created on the first
set
instead of onforDocument
. It would be much cleaner to create the sheet on construction.The text was updated successfully, but these errors were encountered: