cssinjs/jss

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

Open

#1421 aperta il 7 nov 2020

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (434 fork)batch import
bughelp wanted

Metriche repository

Star
 (7000 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor