Skip to content

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

@codehz

Description

@codehz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions