site
site copied to clipboard
[skip netlify]: Bump @xstate/react from 0.8.1 to 1.5.1
Bumps @xstate/react from 0.8.1 to 1.5.1.
Release notes
Sourced from @xstate/react
's releases.
@xstate/react
@1
.5.1Patch Changes
453acacb
#2389 Thanks@davidkpiano
! - An internal issue where thespawnBehavior
import for theuseSpawn(...)
hook was broken internally has been fixed.
@xstate/react
@1
.5.0Minor Changes
432b60f7
#2280 Thanks@davidkpiano
! - Just likeuseInterpret(...)
, other types of actors can now be spawned from behaviors usinguseSpawn(...)
:import { fromReducer } from 'xstate/lib/behaviors'; import { useActor, useSpawn } from '@xstate/react';
type CountEvent = { type: 'INC' } | { type: 'DEC' };
const countBehavior = fromReducer( (count: number, event: CountEvent): number => { if (event.type === 'INC') { return count + 1; } else if (event.type === 'DEC') { return count - 1; }
return count;
}, 0 // initial state );
const Component = () => { const countActorRef = useSpawn(countBehavior); const [count, send] = useActor(countActorRef);
return ( <div> Count: {count} <button onClick={() => send({ type: 'INC' })}>Increment</button> <button onClick={() => send({ type: 'DEC' })}>Decrement</button> </div> ); };
@xstate/react
@1
.4.0Minor Changes
849ec56c
#2286 Thanks@davidkpiano
! - TheuseService(...)
hook will be deprecated, since services are also actors. In future versions, theuseActor(...)
hook should be used instead:-const [state, send] = useService(service);
... (truncated)
Commits
- See full diff in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot will not automatically merge this PR because it includes an out-of-range update to a production dependency.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebase
will rebase this PR -
@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it -
@dependabot merge
will merge this PR after your CI passes on it -
@dependabot squash and merge
will squash and merge this PR after your CI passes on it -
@dependabot cancel merge
will cancel a previously requested merge and block automerging -
@dependabot reopen
will reopen this PR if it is closed -
@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) -
@dependabot badge me
will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in the .dependabot/config.yml
file in this repo:
- Update frequency
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)