From df928ebba6caefee716cc45cd59607e8ea12c588 Mon Sep 17 00:00:00 2001 From: Adam <67035612+damzobridge@users.noreply.github.com> Date: Thu, 27 Jun 2024 15:35:47 -0700 Subject: [PATCH] fix: change initialization from play to load event --- src/hooks/useStateMachineInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useStateMachineInput.ts b/src/hooks/useStateMachineInput.ts index 4e15764..024157a 100644 --- a/src/hooks/useStateMachineInput.ts +++ b/src/hooks/useStateMachineInput.ts @@ -40,7 +40,7 @@ export default function useStateMachineInput( } setStateMachineInput(); if (rive) { - rive.on(EventType.Play, () => { + rive.on(EventType.Load, () => { // Check if the component/canvas is mounted before setting state to avoid setState // on an unmounted component in some rare cases setStateMachineInput();