-
-
Notifications
You must be signed in to change notification settings - Fork 812
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] Types error with motion.create()
in v11.5
#2792
Comments
I'm getting the exact same error would love to see a fix |
Would be great if this could be looked at! |
As a temporary solution until the issue is resolved, we can employ the Slot component provided by Radix UI |
yep, this has just brought everything to a standstill. trying to pass any react-aria components to motion wrapper... import {
Modal,
ModalOverlay,
} from "react-aria-components";
import { motion } from "framer-motion";
const MotionModalOverlay = motion(ModalOverlay);
const MotionModal = motion(Modal); if i hover over the ModalOverlay error i get Argument of type '(props: ModalOverlayProps & RefAttributes<HTMLDivElement>) => ReactElement<any, string | JSXElementConstructor<any>> | null' is not assignable to parameter of type 'string | ForwardRefExoticComponent<ModalOverlayProps & RefAttributes<HTMLDivElement>>'.
Property '$$typeof' is missing in type '(props: ModalOverlayProps & RefAttributes<HTMLDivElement>) => ReactElement<any, string | JSXElementConstructor<any>> | null' but required in type 'ForwardRefExoticComponent<ModalOverlayProps & RefAttributes<HTMLDivElement>>'.ts(2345)
index.d.ts(636, 18): '$$typeof' is declared here.
|
This is ugly but this is how I deal with it for the moment 😬 const AriaModalOverlay = motion.create(ModalOverlay as (typeof ModalOverlay) & {$$typeof: symbol});
const AriaModalMotion = motion.create(AriaModal as (typeof AriaModal) & {$$typeof: symbol}); |
Any update? |
It is very interesting bug, but @emyann provide solution, we need use this construction
|
1. Read the FAQs 👇
2. Describe the bug
Types error with
motion.create()
inv11.5
3. Reproduction
NaN
4. Steps to reproduce
Steps to reproduce the behavior:
First case:
Error:
Second case:
Error:
5. Expected behavior
No types error like in
v11.3.31
.6. Video or screenshots
NaN
7. Environment details
If applicable, let us know which OS, browser, browser version etc you're using.
framer-motion
next
react
typescript
pnpm
Windows 11
The text was updated successfully, but these errors were encountered: