cssinjs/jss

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

Open

#1,421 创建于 2020年11月7日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)JavaScript (7,000 star) (434 fork)batch import
bughelp wanted

描述

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

贡献者指南