Skip to content

Commit

Permalink
fix: check if we have an internal ref to update (#1949)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaellis authored Jul 23, 2022
1 parent 9d1b2e1 commit a2c3a08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/hooks/useTransition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

1 comment on commit a2c3a08

@vercel
Copy link

@vercel vercel bot commented on a2c3a08 Jul 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.