cssinjs/jss

Previous styles not being removed when returning 'null' values using dynamic rule sets.

Open

#1,421 opened on Nov 7, 2020

View on GitHub
 (2 comments) (0 reactions) (0 assignees)JavaScript (434 forks)batch import
bughelp wanted

Repository metrics

Stars
 (7,000 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

NOTE: Similar to https://github.com/cssinjs/jss/issues/1026, but with dynamic rule sets instead of dynamic values.

Just to clarify nomenclature... dynamic rule set Vs. dynamic value:

{
  // DYNAMIC RULE SET
  a: ({color}) => ({
    display: 'inline',
    color: color
  }) ,
  b: {
    display: 'inline',
    // DYNAMIC VALUE
    color: ({ color }) => color
  }
}

Expected behavior: Previous applied values to be removed when respective value is set to null in a dynamic rule set.

Describe the bug: Previous values are not removed causing a number of trouble.

Codesandbox link: https://codesandbox.io/s/fervent-dawn-uomkr

Versions:

  • JSS: 10.4.0
  • Browser: All
  • OS: macOS 10.15.7

Contributor guide