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

[FEATURE] type support of react 19 ref as props #2925

Closed
codehz opened this issue Dec 6, 2024 · 1 comment · Fixed by #2943
Closed

[FEATURE] type support of react 19 ref as props #2925

codehz opened this issue Dec 6, 2024 · 1 comment · Fixed by #2943
Labels
feature New feature or request

Comments

@codehz
Copy link

codehz commented Dec 6, 2024

Is your feature request related to a problem? Please describe.
react 19 support ref as props, but motion.create only allow ForwardRefExoticComponent as input

Describe the solution you'd like
modify the type of motion.create accept normal function component

Describe alternatives you've considered
create a wrapper to cast type

Additional context
current workaround

function createMotion<T>(
  render: FunctionComponent<T>
): ExoticComponent<MotionComponentProps<T>> {
  return motion.create(render as any);
}

I tested, it works in runtime

@codehz codehz added the feature New feature or request label Dec 6, 2024
@faradaytrs
Copy link

Same issue here, i use alpha channel and it still expects to forwardRef

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

Successfully merging a pull request may close this issue.

2 participants