DEV Community

Discussion on: CJS Cascading JavaScript Style

Collapse
 
jaffparker profile image
Jaff Parker

Cool concept. You might just wanna look out for mutating the styles object. In the end when you're passing styles.Item it'll look like this:

{
  background: 'red',
  Large: {
    fontSize: 30
  }
}

Which isn't a valid styles object. If you introduce types to your code, you'll get an error.