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] Property '$$typeof' is missing in `ForwardRefComponent` #2632

Closed jeremybanka closed 3 weeks ago

jeremybanka commented 4 weeks ago

1. FAQs

👍

2. Describe the bug

framer-motion's new definition of ForwardRefComponent has broken compatibility with React.ForwardRefExoticComponent

3. CodeSandbox

CodeSandbox (seems like you'll need to create a fork to run the TS language server...?)

4. Steps to reproduce

Steps to reproduce the behavior:

  1. Create a function that takes a param typed as React.ForwardRefExoticComponent.
  2. Pass motion.div to that component.
  3. You'll get a typescript error noting a missing property $$typeof in framer's ForwardRefComponent.

5. Expected behavior

No typescript error, as in framer-motion@11.1.3

6. Video or screenshots

Screenshot 2024-04-18 at 12 20 02

7. Environment details

TypeScript 5.4.5

jeremybanka commented 4 weeks ago

PR here: https://github.com/framer/motion/pull/2631

mattgperry commented 4 weeks ago

Thanks for the PR! Will publish now