From 1454efc2d62233f572ce4aa2670bf7eef141c1b0 Mon Sep 17 00:00:00 2001 From: Romain Trotard Date: Wed, 10 Sep 2025 17:09:29 +0200 Subject: [PATCH] fix: fix `useTransition` when working with React 18 --- packages/core/src/hooks/useTransition.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }