-
-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Types don't work on on createUseStyles
#1439
Comments
Honestly it's hard to follow. A few changes made since this PR and maybe it broken again. This is the current status: export type JssStyle =
| {
[K in keyof NormalCssProperties]:
| NormalCssValues<K>
| JssStyle
| Func<NormalCssValues<K> | JssStyle | undefined>
| Observable<NormalCssValues<K> | JssStyle | undefined>
}
| {
[K: string]:
| JssValue
| JssStyle
| Func<JssValue | JssStyle | undefined>
| Observable<JssValue | JssStyle | undefined>
} This is the working PR version: export type JssStyle = {
[K in keyof NormalCssProperties | string]:
| NormalCssValues<K>
| JssStyle
| Func<NormalCssValues<K> | JssStyle | undefined>
} Can you change the declaration locally and check if that fixes it for you? |
@moshest when I make the change you suggested I see no change. I also changed
But it's still not working. I even updated my codesandbox to use the version where this was supposed to have been fixed (10.3.0), but I still get no autocomplete. |
Well it needs further investigating. I can share that I did this fix on TypeScript 3.x and the attached test file on the PR worked with autocomplete in WebStorm. |
@moshest I have added you to the core team since you have contributed to many typescript changes already, so you can review and merge them as you see fit, feel free to ping me if anything in twitter dm https://twitter.com/kof |
I believe #1423 has fixed this issue and now works correctly in 10.5.1 |
@goleary can you confirm as well? |
Thanks for the tip @ymor & the ping @moshest It is certainly better in the latest release. I am now getting autocomplete on property names. That said, the traditional react That is not working with Was this ever working in |
we've being using JSS for 2 years and it's never worked. but I've made a PR that should make this work for TypeScript and JavaScript users: #1454 |
Expected behavior:
![image](https://user-images.githubusercontent.com/16123225/103955638-9a429400-50fb-11eb-9b59-2f04dd94bebf.png)
I expect the same type inference/autocompletion when using
createUseStyles
that I get when I use thestyle
attribute in jsx. Here you can see the autocompletion offered on<div style...
Describe the bug:
![image](https://user-images.githubusercontent.com/16123225/103955705-bb0ae980-50fb-11eb-81da-5d79b4cd100e.png)
There is no autocompletion when using
createUseStyles
I'm a little bit confused because it appears as though a PR was merged to fix this behaviour but it doesn't seem to be working: #1352
@moshest is the behavior you were aiming to fix with that PR? or am I misunderstanding something?
Codesandbox link:
https://codesandbox.io/s/react-jss-ts-13cqf
Versions (please complete the following information):
Feel free to add any additional versions which you may think are relevant to the bug.
The text was updated successfully, but these errors were encountered: