@xstate/react
Advanced tools
Comparing version 4.1.0 to 4.1.1
@@ -1,2 +0,4 @@ | ||
import { ActorRef, SnapshotFrom } from 'xstate'; | ||
export declare function useSelector<TActor extends ActorRef<any, any> | undefined, T>(actor: TActor, selector: (emitted: TActor extends ActorRef<any, any> ? SnapshotFrom<TActor> : undefined) => T, compare?: (a: T, b: T) => boolean): T; | ||
import { AnyActorRef } from 'xstate'; | ||
export declare function useSelector<TActor extends Pick<AnyActorRef, 'subscribe' | 'getSnapshot'> | undefined, T>(actor: TActor, selector: (snapshot: TActor extends { | ||
getSnapshot(): infer TSnapshot; | ||
} ? TSnapshot : undefined) => T, compare?: (a: T, b: T) => boolean): T; |
{ | ||
"name": "@xstate/react", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "XState tools for React", | ||
@@ -58,3 +58,3 @@ "keywords": [ | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0", | ||
"xstate": "^5.6.2" | ||
"xstate": "^5.11.0" | ||
}, | ||
@@ -68,6 +68,6 @@ "peerDependenciesMeta": { | ||
"use-isomorphic-layout-effect": "^1.1.2", | ||
"use-sync-external-store": "^1.0.0" | ||
"use-sync-external-store": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"@testing-library/react": "^13.4.0", | ||
"@testing-library/react": "^14.2.1", | ||
"@types/jsdom": "^12.2.3", | ||
@@ -81,4 +81,4 @@ "@types/react": "^17.0.43", | ||
"react-dom": "^18.0.0", | ||
"xstate": "5.6.2" | ||
"xstate": "5.11.0" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # @xstate/react | ||
- [Read the full documentation in the XState docs](https://xstate.js.org/docs/packages/xstate-react/). | ||
- [Read the full documentation in the XState docs](https://stately.ai/docs/xstate-react). | ||
- [Read our contribution guidelines](https://github.com/statelyai/xstate/blob/main/CONTRIBUTING.md). | ||
@@ -19,3 +19,3 @@ | ||
```js | ||
```tsx | ||
import { useMachine } from '@xstate/react'; | ||
@@ -41,3 +41,3 @@ import { createMachine } from 'xstate'; | ||
return ( | ||
<button onClick={() => send('TOGGLE')}> | ||
<button onClick={() => send({ type: 'TOGGLE' })}> | ||
{state.value === 'inactive' | ||
@@ -44,0 +44,0 @@ ? 'Click to activate' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35160
848