diff --git a/src/create-storage-hook/index.ts b/src/create-storage-hook/index.ts index e59a1ff2..3a14e5f2 100644 --- a/src/create-storage-hook/index.ts +++ b/src/create-storage-hook/index.ts @@ -34,7 +34,7 @@ export interface UseStorageParserOption { deserializer: Deserializer } -function getServerSnapshotWithoutServerValue() { +function getServerSnapshotWithoutServerValue(): never { throw noSSRError('useLocalStorage cannot be used on the server without a serverValue'); } diff --git a/src/use-url-hash-state/index.ts b/src/use-url-hash-state/index.ts index cad07662..3869c606 100644 --- a/src/use-url-hash-state/index.ts +++ b/src/use-url-hash-state/index.ts @@ -53,7 +53,7 @@ export interface UseUrlHashStateParserOption { deserializer: Deserializer } -function getServerSnapshotWithoutServerValue() { +function getServerSnapshotWithoutServerValue(): never { throw noSSRError('useUrlHashState cannot be used on the server without a serverValue'); }