github statelyai/xstate @xstate/solid@3.0.0-beta.0

latest releases: @xstate/vue@6.0.0-beta.0, @xstate/test@2.0.0-beta.0, @xstate/svelte@6.0.0-beta.0...
pre-release3 hours ago

Minor Changes

  • 81dd3dd: useActorRef, useActor and useMachine accept an already-created actor, such as one from restoreActor. The snapshot option is removed; restore the actor with restoreActor from xstate/persist and pass it to the hook. The hook starts the actor on mount and stops it on unmount, as it does for actors it creates. Create the actor once per component instance.

    import { useActor } from '@xstate/solid';
    import { restoreActor } from 'xstate/persist';
    
    function App(props) {
      const [snapshot, send] = useActor(restoreActor(machine, props.persisted));
      // ...
    }

Patch Changes

  • 6cf6982: XState v6 enters beta. No further breaking changes are planned for APIs tagged @public; any that are needed will be called out with a migration path. APIs tagged @experimental may still change.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.