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

[BUG] Cannot find name 'AnimationControls'. #2988

Open
watery-desert opened this issue Jan 10, 2025 · 3 comments
Open

[BUG] Cannot find name 'AnimationControls'. #2988

watery-desert opened this issue Jan 10, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@watery-desert
Copy link

watery-desert commented Jan 10, 2025

1. Read the FAQs 👇
Yes
2. Describe the bug
After updating to v11.16.0 or above from v11.14.1 I am not able to import AnimationControls type. Which is the type of useAnimation() I need this to pass this as prop. My react version is v19.0.0

.
.
You can see in this screenshot, I am no longer able to import AnimationControls. 👇
.
Screenshot 2025-01-10 at 08 09 19

.
.
And the type of useAnimation() is inferring AnimationControls 👇
.
Screenshot 2025-01-10 at 08 19 43

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/p/github/watery-desert/motion-animation-controls-bug/main?import=true

@watery-desert watery-desert added the bug Something isn't working label Jan 10, 2025
@ghost91-
Copy link

Running into the same issue. As a workaround, until there is a proper fix, you can do:

import { type animationControls } from 'framer-motion';

type AnimationControls = ReturnType<typeof animationControls>;

@Adesh-Pandey
Copy link
Contributor

I ran into this one as well. The fix above works but would be annoying to use in 10 15 files i use it in. (I could export from sigle place but would like to go back to original import once this is fixed.)
Guess I m just gonna downgrade.

@Adesh-Pandey
Copy link
Contributor

I have PR that resolved the issue.
But will have to have a conversation with @mattgperry for further step and best practise.
I did verify it's effectiveness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants