diff --git a/.changeset/silent-dragons-jog.md b/.changeset/silent-dragons-jog.md new file mode 100644 index 0000000000..2167d57c0f --- /dev/null +++ b/.changeset/silent-dragons-jog.md @@ -0,0 +1,5 @@ +--- +'@xstate/vue': patch +--- + +The `useActor` hook now correctly types it's `send` function when passed an `ActorLogic`. diff --git a/packages/xstate-vue/src/useActor.ts b/packages/xstate-vue/src/useActor.ts index 127292c87f..acdd3c4194 100644 --- a/packages/xstate-vue/src/useActor.ts +++ b/packages/xstate-vue/src/useActor.ts @@ -4,7 +4,6 @@ import { ActorOptions, ActorRefFrom, AnyActorLogic, - EventFrom, Snapshot, SnapshotFrom } from 'xstate'; @@ -16,7 +15,7 @@ export function useActor( options?: ActorOptions ): { snapshot: Ref>; - send: (event: EventFrom) => void; + send: (event: ActorRefFrom['send']) => void; actorRef: ActorRefFrom; }; export function useActor(