cssinjs/jss

createUseStyles + @media + Adapting based on props: not updating correctly

Open

#1,327 创建于 2020年4月7日

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

描述

Expected behavior: When a property is changed, styles that are inside a @media selector are not being re-generated.

Describe the bug: When a property is changed, all styles that are properties-dependent should be re-generated and re-applied to the component.

Steps:

  1. "Swap color" button loads with background red and border/text-shadow blue
  2. Click on the "Swap color" button
  3. Background is changed to "blue" ✅
  4. Text-shadow is changed to "red" ✅
  5. Border is kept "blue" ❌

Codesandbox link: https://codesandbox.io/s/createusestyles-media-vf5zs

Versions (please complete the following information):

  • react-jss: 10.1.1
  • Browser [e.g. chrome, safari]: chrome (but all)
  • OS [e.g. Windows, macOS]: macOs (but all) Feel free to add any additional versions which you may think are relevant to the bug.

贡献者指南