UNPKG

628 BTypeScriptView Raw
1import * as React from 'react';
2import { Actor, ActorOptions, AnyActorLogic, SnapshotFrom } from 'xstate';
3export declare function createActorContext<TLogic extends AnyActorLogic>(actorLogic: TLogic, actorOptions?: ActorOptions<TLogic>): {
4 useSelector: <T>(selector: (snapshot: SnapshotFrom<TLogic>) => T, compare?: (a: T, b: T) => boolean) => T;
5 useActorRef: () => Actor<TLogic>;
6 Provider: (props: {
7 children: React.ReactNode;
8 options?: ActorOptions<TLogic>;
9 /** @deprecated Use `logic` instead. */
10 machine?: never;
11 logic?: TLogic;
12 }) => React.ReactElement<any, any>;
13};