Jss: Dynamic values update issue

Created on 10 Jun 2019  路  6Comments  路  Source: cssinjs/jss

__Expected behavior:__
Dynamic values should update.

__Describe the bug:__
Dynamic values don't update.

__Codesandbox link:__
https://codesandbox.io/s/material-demo-xivoe

const styles = {
  root: props => ({
    "@media print": {
      display: props.print
    }
  })
};

__Versions (please complete the following information):__

bug moderate important

Most helpful comment

This specifically happens with media queries. I can see that instead of updating the media query, it creates a new empty one.

cc @HenriBeck it might be related to the issue we have seen with styled-system and duplicated media queries.

All 6 comments

This specifically happens with media queries. I can see that instead of updating the media query, it creates a new empty one.

cc @HenriBeck it might be related to the issue we have seen with styled-system and duplicated media queries.

yeah, basically we would need to remove the old one. I think in general there is an issue with creating nested rules inside dynamic rules

Hi
I have the same issue
when I log the sheet output using (sheet.toString) it shows a valid value :
image
but when I check the element's css from the inspector, it dosen't show the media query rules

@bardouni can you provide a codesandbox so we can check your code?

Usually, there is an alternative syntax where the issue doesn't exist

This also might be fixed with #1144

fixed in https://github.com/cssinjs/jss/pull/1242, releasing in 10.0.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pofigizm picture pofigizm  路  5Comments

brianmhunt picture brianmhunt  路  5Comments

HenriBeck picture HenriBeck  路  4Comments

kof picture kof  路  6Comments

kof picture kof  路  4Comments