diff --git a/packages/core/src/hooks/useTransition.tsx b/packages/core/src/hooks/useTransition.tsx index 940b55e6ee..50546961b7 100644 --- a/packages/core/src/hooks/useTransition.tsx +++ b/packages/core/src/hooks/useTransition.tsx @@ -436,9 +436,9 @@ export function useTransition( const key = is.str(t.key) || is.num(t.key) ? t.key : t.ctrl.id const isLegacyReact = React.version < '19.0.0' - const props = elem?.props ?? {} + const props = { ...elem?.props } - if (isLegacyReact) { + if (isLegacyReact && elem && elem.type) { props.ref = elem.ref }