diff --git a/src/mantine-hooks/src/use-local-storage/create-storage.ts b/src/mantine-hooks/src/use-local-storage/create-storage.ts index a5cbac59023..499e0c1987e 100644 --- a/src/mantine-hooks/src/use-local-storage/create-storage.ts +++ b/src/mantine-hooks/src/use-local-storage/create-storage.ts @@ -48,7 +48,12 @@ export function createStorage(type: StorageType, hookName: string) { }: IStorageProperties) { const readStorageValue = useCallback( (skipStorage?: boolean): T => { - if (typeof window === 'undefined' || !(type in window) || skipStorage) { + if ( + typeof window === 'undefined' || + !(type in window) || + window[type] === null || + skipStorage + ) { return (defaultValue ?? '') as T; }