Skip to content
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

useImperativeMethods error with react@16.8.1 & react-spring@7.2.10 #513

Closed
AquiGorka opened this issue Feb 7, 2019 · 8 comments
Closed

Comments

@AquiGorka
Copy link

Getting an error: (0 , _react.useImperativeMethods) is not a function

https://codesandbox.io/s/x9pkx031ro

Any idea? Thanks

@AquiGorka AquiGorka changed the title Mix with react@16.8.1 & react-spring@7.2.10 useImperativeMethods error with react@16.8.1 & react-spring@7.2.10 Feb 7, 2019
@drcmda
Copy link
Member

drcmda commented Feb 7, 2019

hey gorka! yep, its an outdated react-spring in there. the api is outdated, too. here's an updated version: https://codesandbox.io/s/8zx4ppk01l

@AquiGorka
Copy link
Author

Hello @drcmda ,
I thought that could be it, is there a way to use react-spring@7.x.x with react@hooks (16.8.x)?

@drcmda
Copy link
Member

drcmda commented Feb 7, 2019

React had some breaking changes in the hooks release, useState works differently and useImperativeHandle is new. That makes it hard to backport unfortunately. These things only affect the hooks api, the normal 7.x main export should work fine in react 16.8.x

@daryl
Copy link

daryl commented Feb 7, 2019

Having the same issue here.

@AquiGorka
Copy link
Author

@drcmda thanks for the clarification! I'll have to update all usage of react-spring 7 -> 8 before trying out hooks.

@drcmda
Copy link
Member

drcmda commented Feb 7, 2019

is this for aragon? it uses the renderprops api so there shouldn't be a problem, we could hang out on jitsi if its pressing

@AquiGorka
Copy link
Author

AquiGorka commented Feb 8, 2019

@drcmda yes, it is for a swipe-able version of the menu panel I'm working on (PR here) I am using your react-with-gesture tool 😄 and wanted to try out hooks too.

There's no rush, I'll update react-spring and then use hooks. Thanks

@drcmda
Copy link
Member

drcmda commented Feb 8, 2019

wow, that looks really cool! let me know if you need help with something!

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

No branches or pull requests

3 participants