Skip to content

Dynamic props for media queries do not update with attach before #511

@lttb

Description

@lttb

Online example

Does not work:

const styles = {
  container: {
    padding: props => props.active ? 10 : 20,
    '@media screen and (min-width: 100px)': {
      color: 'red',
      background: props => (props.active ? 'white' : 'gray')
    }
  }
}

const sheet = jss.createStyleSheet(styles, {link: true}).attach()
sheet.update({active: false})

Works:

const styles = {
  container: {
    padding: props => props.active ? 10 : 20,
    '@media screen and (min-width: 100px)': {
      color: 'red',
      background: props => (props.active ? 'white' : 'gray')
    }
  }
}

const sheet = jss.createStyleSheet(styles, {link: true})
sheet.update({active: false}).attach()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIt went crazy and killed everyone.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions