Skip to content

Commit

Permalink
fix: relax storage hook type
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jun 7, 2024
1 parent 3c4515e commit 1301285
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/create-storage-hook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ export function createStorage(type: StorageType) {
key: string,
serverValue: NotUndefined<T>,
options?: UseStorageRawOption | UseStorageParserOption<T>
): readonly [NotUndefined<T>, React.Dispatch<React.SetStateAction<T | null>>];
): readonly [T, React.Dispatch<React.SetStateAction<T | null>>];
// client-render only
function useStorage<T>(
key: string,
serverValue?: undefined,
options?: UseStorageRawOption | UseStorageParserOption<T>
): readonly [NotUndefined<T> | null, React.Dispatch<React.SetStateAction<T | null>>];
): readonly [T | null, React.Dispatch<React.SetStateAction<T | null>>];
function useStorage<T>(
key: string,
serverValue?: NotUndefined<T> | undefined,
Expand Down

0 comments on commit 1301285

Please sign in to comment.