Stately
XState v6 alpha

Input and restored snapshots

Start Solid actors with input or persisted state.

XState v6 is in alpha

APIs and behavior may change before the stable release.

Pass actor options as the second helper argument.

const [snapshot, send] = useActor(machine, {
  input: { userId },
  snapshot: persistedSnapshot
});

Input creates new initial state. A persisted snapshot restores earlier state.

Use input to start a profile actor for one userId. Use a restored snapshot to resume a checkout after a refresh.