From 13012858295758a95fb82a121f71fd3fdd2f8fe2 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Fri, 7 Jun 2024 16:02:42 +0800 Subject: [PATCH] fix: relax storage hook type --- src/create-storage-hook/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/create-storage-hook/index.ts b/src/create-storage-hook/index.ts index 9776deaf..195408ce 100644 --- a/src/create-storage-hook/index.ts +++ b/src/create-storage-hook/index.ts @@ -106,13 +106,13 @@ export function createStorage(type: StorageType) { key: string, serverValue: NotUndefined, options?: UseStorageRawOption | UseStorageParserOption - ): readonly [NotUndefined, React.Dispatch>]; + ): readonly [T, React.Dispatch>]; // client-render only function useStorage( key: string, serverValue?: undefined, options?: UseStorageRawOption | UseStorageParserOption - ): readonly [NotUndefined | null, React.Dispatch>]; + ): readonly [T | null, React.Dispatch>]; function useStorage( key: string, serverValue?: NotUndefined | undefined,