Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xstate/react

Package Overview
Dependencies
Maintainers
3
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xstate/react - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

6

dist/declarations/src/useSelector.d.ts

@@ -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'

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc