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 499e0c1987e..e674756f308 100644 --- a/src/mantine-hooks/src/use-local-storage/create-storage.ts +++ b/src/mantine-hooks/src/use-local-storage/create-storage.ts @@ -54,12 +54,12 @@ export function createStorage(type: StorageType, hookName: string) { window[type] === null || skipStorage ) { - return (defaultValue ?? '') as T; + return defaultValue as T; } const storageValue = window[type].getItem(key); - return storageValue !== null ? deserialize(storageValue) : ((defaultValue ?? '') as T); + return storageValue !== null ? deserialize(storageValue) : (defaultValue as T); }, [key, defaultValue] );