Skip to content

Commit

Permalink
Fixed compatibility of the generated TS types for `createActorContext…
Browse files Browse the repository at this point in the history
…` with pre-4.7 (#3829)
  • Loading branch information
Andarist committed Feb 13, 2023
1 parent eefd0d5 commit c110c42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/healthy-fireants-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/react': patch
---

Fixed compatibility of the generated TS types for `createActorContext` with pre-4.7.
2 changes: 1 addition & 1 deletion packages/xstate-react/src/createActorContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function createActorContext<TMachine extends AnyStateMachine>(
| Observer<StateFrom<TMachine>>
| ((value: StateFrom<TMachine>) => void)
): {
useActor: () => ReturnType<typeof useActorUnbound<ActorRefFrom<TMachine>>>;
useActor: () => [StateFrom<TMachine>, ActorRefFrom<TMachine>['send']];
useSelector: <T>(
selector: (snapshot: EmittedFrom<TMachine>) => T,
compare?: (a: T, b: T) => boolean
Expand Down

0 comments on commit c110c42

Please sign in to comment.