# xstate/release
XState @xstate/svelte@6.0.0-beta.0
importance: highbreakingmigrationfeatureprerelease
The Svelte hooks `useActorRef`, `useActor`, and `useMachine` now accept an already-created actor, including one restored with `restoreActor`. The `snapshot` option is removed; the hook starts the supplied actor and stops it when the component is destroyed. This release also marks XState v6 as beta, with no further breaking changes planned for `@public` APIs and possible changes to `@experimental` APIs.
affected
Svelte users who restore actor state or use the removed `snapshot` option are affected.
action
Update code using the `snapshot` option to restore and pass an actor as shown in the release notes.
release_signals
-The `snapshot` option is removed; restore an actor with `restoreActor` from `xstate/persist` and pass the actor to the hook instead.
+`useActorRef`, `useActor`, and `useMachine` accept an already-created actor, including an actor restored with `restoreActor`.
migration_steps2 steps
- 01Replace use of the `snapshot` option with `restoreActor` from `xstate/persist`, then pass the restored actor to the hook.
- 02Create the actor once per component instance; the hook starts it and stops it when the component is destroyed.
code_snippet
import { useActor } from '@xstate/svelte';
import { restoreActor } from 'xstate/persist';
const { snapshot, send } = useActor(restoreActor(machine, persisted));# community_signal
How useful is this release to your stack?
—
net score
Sign in with GitHub to cast your vote.
Sign in with GitHub to vote
You’ll return to this release, then choose your vote.