Skip to content

Commit

Permalink
v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Apr 12, 2024
1 parent 453aaf5 commit 13990cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

## [0.0.3] - 2024-04-12
### Changed
- Compatibility with SSR again

## [0.0.2] - 2024-04-11
### Changed
- Compatibility with SSR
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "use-signals",
"description": "An experimental React hook for TC39 signals",
"version": "0.0.2",
"version": "0.0.3",
"type": "module",
"author": "Daishi Kato",
"repository": {
Expand Down
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import ReactExports from 'react';
import { useCallback, useSyncExternalStore } from 'react';
import { Signal } from 'signal-polyfill';

const { useCallback, useSyncExternalStore } = ReactExports;

export { Signal };

type AnySignal<T> = Signal.State<T> | Signal.Computed<T>;
Expand All @@ -28,5 +26,5 @@ export function useSignal<T>(signal: AnySignal<T>): T {
[signal],
);
const getSnapshot = () => signal.get();
return useSyncExternalStore(subscribe, getSnapshot);
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
}

0 comments on commit 13990cc

Please sign in to comment.