createActorContext
Callable
Type parameters
- TLogic: AnyActorLogic
Parameters
actorLogic: TLogic
optionalinterpreterOptions: ActorOptions<TLogic>
Returns { Provider: (props: { children: React.ReactNode; machine?: never; options?: ActorOptions<TLogic> } & (TLogic extends AnyStateMachine ? AreAllImplementationsAssumedToBeProvided<TLogic[__TResolvedTypesMeta]> extends true ? { logic?: TLogic } : { logic: ToMachinesWithProvidedImplementations<TLogic> } : { logic?: TLogic })) => React.ReactElement<any, any>; useActorRef: () => ActorRefFrom<TLogic>; useSelector: <T>(selector: (snapshot: SnapshotFrom<TLogic>) => T, compare?: (a: T, b: T) => boolean) => T }
Provider: (props: { children: React.ReactNode; machine?: never; options?: ActorOptions<TLogic> } & (TLogic extends AnyStateMachine ? AreAllImplementationsAssumedToBeProvided<TLogic[__TResolvedTypesMeta]> extends true ? { logic?: TLogic } : { logic: ToMachinesWithProvidedImplementations<TLogic> } : { logic?: TLogic })) => React.ReactElement<any, any>
Parameters
props: { children: React.ReactNode; machine?: never; options?: ActorOptions<TLogic> } & (TLogic extends AnyStateMachine ? AreAllImplementationsAssumedToBeProvided<TLogic[__TResolvedTypesMeta]> extends true ? { logic?: TLogic } : { logic: ToMachinesWithProvidedImplementations<TLogic> } : { logic?: TLogic })
Returns React.ReactElement<any, any>
useActorRef: () => ActorRefFrom<TLogic>
Returns ActorRefFrom<TLogic>
useSelector: <T>(selector: (snapshot: SnapshotFrom<TLogic>) => T, compare?: (a: T, b: T) => boolean) => T
Type parameters
- T
Parameters
selector: (snapshot: SnapshotFrom<TLogic>) => T
optionalcompare: (a: T, b: T) => boolean
Returns T