diff --git a/packages/core/src/use-animator/index.ts b/packages/core/src/use-animator/index.ts index 2f93782..c87fe45 100644 --- a/packages/core/src/use-animator/index.ts +++ b/packages/core/src/use-animator/index.ts @@ -159,6 +159,7 @@ export default function useAnimationState>( controller.current = { __state, transitionTo(nextStateOrFunction) { + 'worklet' const runTransition = (nextStateKey: keyof V) => { selectedVariant.current = nextStateKey diff --git a/packages/core/src/use-dynamic-animation/index.ts b/packages/core/src/use-dynamic-animation/index.ts index 5b00827..46cc157 100644 --- a/packages/core/src/use-dynamic-animation/index.ts +++ b/packages/core/src/use-dynamic-animation/index.ts @@ -53,13 +53,14 @@ export default function useDynamicAnimation( const controller = useRef() - if (controller.current === null) { + if (controller.current == null) { controller.current = { __state, get current(): DynamicStyleProp { return activeStyle.current.value }, animateTo(nextStateOrFunction) { + 'worklet' const runAnimation = (nextStyleObject: DynamicStyleProp) => { if (nextStyleObject) { activeStyle.current.value = nextStyleObject