github statelyai/xstate @xstate/react@4.1.0

latest releases: xstate@5.14.0, @xstate/store@1.0.0, xstate@5.13.2...
4 months ago

Minor Changes

  • #4231 c2402e7bc Thanks @davidkpiano! - The actor passed to useSelector(actor, selector) is now allowed to be undefined for an actor that may not exist yet. For actors that may be undefined, the snapshot provided to the selector function can also be undefined:

    const count = useSelector(maybeActor, (snapshot) => {
      // `snapshot` may be undefined
      return snapshot?.context.count;
    });
    
    count; // number | undefined

Don't miss a new xstate release

NewReleases is sending notifications on new releases.