Thanks to visit codestin.com
Credit goes to github.com

Skip to content

React 19 compatible #66

@axetroy

Description

@axetroy
Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.
elementRefGetterWithDeprecationWarning	@	react.development.js?9f62:193
CSSMotion	@	CSSMotion.js?a4ab:124

motion/src/CSSMotion.tsx

Lines 241 to 253 in e9cb099

// Auto inject ref if child node not have `ref` props
if (React.isValidElement(motionChildren) && supportRef(motionChildren)) {
const originNodeRef = getNodeRef(motionChildren);
if (!originNodeRef) {
motionChildren = React.cloneElement(
motionChildren as React.ReactElement,
{
ref: nodeRef,
},
);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions