@preact/signals-react
Advanced tools
Comparing version 2.0.0 to 2.0.1
# @preact/signals-react | ||
## 2.0.1 | ||
### Patch Changes | ||
- [#535](https://github.com/preactjs/signals/pull/535) [`58befba`](https://github.com/preactjs/signals/commit/58befba577d02c5cac5292fda0a599f9708e908b) Thanks [@jviide](https://github.com/jviide)! - Publish packages with provenance statements | ||
- Updated dependencies [[`d846def`](https://github.com/preactjs/signals/commit/d846defaf6e64f0236e2b91247e5f94a35f29cbc), [`cb6bdab`](https://github.com/preactjs/signals/commit/cb6bdabbd31b27f8435c7976089fa276da6bfb7a), [`d846def`](https://github.com/preactjs/signals/commit/d846defaf6e64f0236e2b91247e5f94a35f29cbc), [`d846def`](https://github.com/preactjs/signals/commit/d846defaf6e64f0236e2b91247e5f94a35f29cbc), [`d846def`](https://github.com/preactjs/signals/commit/d846defaf6e64f0236e2b91247e5f94a35f29cbc)]: | ||
- @preact/signals-core@1.6.0 | ||
## 2.0.0 | ||
@@ -4,0 +13,0 @@ |
{ | ||
"name": "@preact/signals-react", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"license": "MIT", | ||
@@ -64,3 +64,3 @@ "description": "Manage state with style in React", | ||
"dependencies": { | ||
"@preact/signals-core": "^1.5.1", | ||
"@preact/signals-core": "^1.6.0", | ||
"use-sync-external-store": "^1.2.0" | ||
@@ -79,3 +79,6 @@ }, | ||
}, | ||
"publishConfig": { | ||
"provenance": true | ||
}, | ||
"scripts": {} | ||
} |
@@ -61,3 +61,3 @@ # Signals | ||
See the [Readme for the Babel plugin](../babel-plugin-signals-react/README.md) for more details about how the transform works and configuring it. | ||
See the [Readme for the Babel plugin](../react-transform/README.md) for more details about how the transform works and configuring it. | ||
@@ -69,3 +69,3 @@ ### `useSignals` hook | ||
```js | ||
import { useSignals } from "@preact/signals-react"; | ||
import { useSignals } from "@preact/signals-react/runtime"; | ||
@@ -82,6 +82,6 @@ const count = signal(0); | ||
If you need to instantiate new signals inside your components, you can use the `useSignal` or `useComputed` hook. | ||
If you need to instantiate new signals or create new side effects on signal changes inside your components, you can use the `useSignal`, `useComputed` and `useSignalEffect` hooks. | ||
```js | ||
import { useSignal, useComputed } from "@preact/signals-react"; | ||
import { useSignal, useComputed, useSignalEffect } from "@preact/signals-react"; | ||
@@ -92,2 +92,6 @@ function Counter() { | ||
useSignalEffect(() => { | ||
console.log(`Value: ${count.value}, value x 2 = ${double.value}`); | ||
}); | ||
return ( | ||
@@ -94,0 +98,0 @@ <button onClick={() => count.value++}> |
218256
170
Updated@preact/signals-core@^1.6.0