Skip to content

No auto-completion for useSpring config? #383

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

Closed
JasCodes opened this issue Dec 19, 2018 · 10 comments
Closed

No auto-completion for useSpring config? #383

JasCodes opened this issue Dec 19, 2018 · 10 comments
Labels
area: typescript Typescript issues
Milestone

Comments

@JasCodes
Copy link

I have compiled and published master with hooks types at npm @jas99/react-spring
If you see the picture below, not getting full intellisense in vscode

screenshot from 2018-12-19 11-58-28

Thx

@JasCodes
Copy link
Author

animated in react-spring/hooks missing as animated from react-spring don't seems to work for the ones for hooks
thx
screenshot from 2018-12-19 15-34-29

@JasCodes
Copy link
Author

cc 😄 @Kovensky

@Jessidhia
Copy link
Contributor

Ah, I hadn't noticed that animated was also exported from hooks.

As for intellisense "not working", it actually is working, but the other way around. It is making the type of your output (the { opacity } you're destructuring) be the same as the type of your inputs, and then later when you try to use it TypeScript will check if your opacity is compatible with the expected type of wherever you try to use it.

If you want to tell TypeScript what you want the type of your input to be instead, you can try using useSpring<ForwardedProps<React.CSSProperties>>(...) (CSSProperties because you seem to be trying to animate a style object).

@Jessidhia
Copy link
Contributor

I wonder if using it to animate CSSProperties is a common enough usecase. Could be worth it to add a less generic overload that matches if all the properties you give are also valid CSSProperties.

@JasCodes
Copy link
Author

@Kovensky Yeah less generic overload makes sense, and thx for explaining types issue, completely made sense.

And thx for contributing types in the first place 😄

What I am sayin.. is allot of thx 😹

@JasCodes
Copy link
Author

JasCodes commented Dec 19, 2018

Hey @Kovensky
How do I populate SpringBaseProps, I originally was looking for base spring props and not for css properties.

Thx

@drcmda
Copy link
Member

drcmda commented Dec 19, 2018

@Kovensky merged the exp-chaining branch into master today - it contains the latest hooks code in case there's something missing. Btw, the offer still stands: #381 (comment) We'd be super thrilled 😊

@JasCodes
Copy link
Author

Hey @drcmda
Thx for awesome lib 😃

I had couple of issues stated above, one with missing animated object from hook lib seems straight forward and the other is default props I see without using of any template; might take few tweaks by @Kovensky

Thx

@JasCodes
Copy link
Author

Hey @Kovensky #386 seems to confirm what I am saying.

@aleclarson aleclarson added the area: typescript Typescript issues label Apr 1, 2019
@aleclarson aleclarson changed the title hooks type issue No auto-completion for useSpring config? Apr 1, 2019
@aleclarson aleclarson mentioned this issue Apr 15, 2019
5 tasks
@aleclarson aleclarson added this to the v9.0.0 milestone Apr 23, 2019
@ghost
Copy link

ghost commented Aug 1, 2022

Hi have great day, Problem still exist and auto-completion not work or stay in loading stage in Vscode editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: typescript Typescript issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants