From 85e77b9b008b53cede29ab09b6ee25d081a67d42 Mon Sep 17 00:00:00 2001 From: Josh <37798644+joshuaellis@users.noreply.github.com> Date: Fri, 22 Jul 2022 23:53:35 +0100 Subject: [PATCH] fix: check if we have an internal ref to update resolves #1948 --- packages/core/src/hooks/useTransition.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/hooks/useTransition.tsx b/packages/core/src/hooks/useTransition.tsx index 8f6cffb9c0..959956b112 100644 --- a/packages/core/src/hooks/useTransition.tsx +++ b/packages/core/src/hooks/useTransition.tsx @@ -110,6 +110,7 @@ export function useTransition( * * See https://github.com/pmndrs/react-spring/issues/1890 */ + each(transitions, t => { ref?.add(t.ctrl) t.ctrl.ref = ref @@ -406,7 +407,7 @@ export function useTransition( * Unless we have exitBeforeEnter in which case will skip * to enter the new animation straight away as if they "overlapped" */ - if (ctrl.ref && !forceChange.current) { + if ((ctrl.ref || ref) && !forceChange.current) { ctrl.update(payload) } else { ctrl.start(payload)