Open pshurygin opened 4 years ago
import jss from 'jss'
const sheet = jss.createStyleSheet({
a: {color: 'red'}
}, {link: true}).attach()
sheet.getRule('a').prop('color', 'green')
@kof I'm sorry, but what does your comment have to do with the issue? I'm not asking for a code example, actually my code is pretty much the same as yours.
The problem is that i'm using jss combined with typescript, which validates types based on type definitions, provided by the jss v10, and typescript compilation of this line of code fails due to incorrectly provided type definitions.
I interpreted your problem as if you have a runtime error, sorry. cc @HenriBeck
@kof It seems like we just need to add a prop
attribute to the Rule type definition somewhere around here: https://github.com/cssinjs/jss/blob/3c335148f5ba3dbe9d6fb017356f64a8fe6a3776/packages/jss/src/index.d.ts#L105-L116
I'm looking to help with some open source issues. I'm happy to create a PR for this.
@tcoughlin3 totally send a PR, if you want to sync about how you could help on other issues, feel free to either just search for them or ping me in dm on gitter to find issues for you to work on
Describe the bug:
Code like this:
styleSheet.getRule('ruleName').prop('propName', propValue)
used to work perfectly fine with jss 9.x, but with v10.0.0 it fails with the following typescript error during build:
Expected behavior:
No typescript compile error
Versions: