Skip to content

Commit 174bd19

Browse files
committed
Release 0.2.9
1 parent 2b5cd13 commit 174bd19

5 files changed

Lines changed: 5 additions & 8 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ being found.
5858
- `useMemo` can be called without a second argument to default to an empty
5959
dependency array.
6060
- `setState` returns the most recently set value.
61-
- `useState` returns a third element that is the same as `setState` but will not trigger a re-render.
6261
- There is no `useLayoutEffect`.
6362
- `useEffect` is called immediately after the DOM is reconciled.
6463
- Portals can be used with the `Portal` component instead of `createPortal`.

docs/dist.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "endr",
33
"type": "module",
4-
"version": "0.2.8",
4+
"version": "0.2.9",
55
"author": "Casey Foster <c@sey.me>",
66
"license": "MIT",
77
"repository": {

src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366

367367
/**
368368
* @template T
369-
* @typedef {[T, SetState<T>, SetState<T>]} State
369+
* @typedef {[T, SetState<T>]} State
370370
*/
371371

372372
const { console, Element, queueMicrotask } = globalThis;
@@ -640,9 +640,7 @@ export const useState = initial => {
640640
queueUpdate(vnode);
641641
}
642642
return value;
643-
},
644-
maybeValue =>
645-
(state[0] = isFunction(maybeValue) ? maybeValue(state[0]) : maybeValue)
643+
}
646644
]);
647645
return state;
648646
};

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ export type Context<T> = ((props: {
311311
value: T;
312312
};
313313
export type SetState<T> = <U extends T>(value: (T extends AnyFunction ? never : U) | ((current: T) => U)) => U;
314-
export type State<T> = [T, SetState<T>, SetState<T>];
314+
export type State<T> = [T, SetState<T>];
315315
/**
316316
* @param {Props} prev
317317
* @param {Props} next

0 commit comments

Comments
 (0)