cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.08k stars 399 forks source link

[react-jss] withStyles typings should take strings as object values #1114

Closed rafamel closed 5 years ago

rafamel commented 5 years ago

Is your feature request related to a problem? withStyles gives a type error when taking a string as object value despite jss-plugin-template being a default plugin:

withStyles({
  root: `font-size: 1em;`
});

Describe the solution you'd like withStyles should not error out when taking strings as object values. This should also be taken into account for the new hooks api.

Are you willing to implement it? Yes

Edit: It looks like the culprit is jss exported Style: export type Style = { [key: string]: Style | any }.

kof commented 5 years ago

Are you talking about flowtype or typescript?

rafamel commented 5 years ago

Hi @kof , this is a TS issue :)

HenriBeck commented 5 years ago

Will be fixed in #1155