cssinjs / cssinjs/jss

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

Open
#1,327 7 comments 2 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
JavaScript
Stars
7.1k
Forks
386
PR merge metrics
No merged PRs in 30d

Description

__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" ✅
3. Text-shadow is changed to "red" ✅
3. 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.