framer / motion

Open source, production-ready animation and gesture library for React
https://framer.com/motion
MIT License
22.27k stars 733 forks source link

[BUG] react@beta (19) breaks motion's type #2640

Closed codehz closed 2 days ago

codehz commented 3 weeks ago

1. Read the FAQs 👇

2. Describe the bug

Give a clear and concise description of what the bug is.

when install react@beta with framer-motion@11.1.7, the type of motion are broken, make

<motion.div className="test" />

be marked as error in typescript (in fact all props from div are not applicable in motion.div

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

A CodeSandbox minimal reproduction will allow us to quickly follow the reproduction steps. Without one, this bug report won't be accepted.

https://codesandbox.io/p/devbox/pcm9tk?migrateFrom=n48ymv

4. Steps to reproduce

Just see the type error, it is not bug about behavior

5. Expected behavior

no type error when works with react 19 beta

6. Video or screenshots

image

7. Environment details

"react": "19.0.0-beta-94eed63c49-20240425", "react-dom": "19.0.0-beta-94eed63c49-20240425", "@types/react": "npm:types-react@beta", "@types/react-dom": "npm:types-react-dom@beta"

mattgperry commented 2 days ago

Closed in favour of https://github.com/framer/motion/issues/2668