From d7cab1bbf7f9ec47d573d48b3221d4aa23737c1a Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Thu, 10 Jun 2021 00:04:46 -0500 Subject: [PATCH] fix: Fixing initializer type for useState --- hooks/src/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hooks/src/index.d.ts b/hooks/src/index.d.ts index b6adbac891..c9f6788d38 100644 --- a/hooks/src/index.d.ts +++ b/hooks/src/index.d.ts @@ -9,6 +9,11 @@ export type StateUpdater = (value: S | ((prevState: S) => S)) => void; */ export function useState(initialState: S | (() => S)): [S, StateUpdater]; +export function useState(): [ + S | undefined, + StateUpdater +]; + export type Reducer = (prevState: S, action: A) => S; /** * An alternative to `useState`.