diff --git a/packages/docusaurus-theme-common/src/utils/storageUtils.ts b/packages/docusaurus-theme-common/src/utils/storageUtils.ts index a8c8825b2267..904d0315c1dd 100644 --- a/packages/docusaurus-theme-common/src/utils/storageUtils.ts +++ b/packages/docusaurus-theme-common/src/utils/storageUtils.ts @@ -228,13 +228,7 @@ export function useStorageSlot( const currentValue = useSyncExternalStore( listen, - () => { - // TODO this check should be useless after React 18 - if (typeof window === 'undefined') { - return null; - } - return storageSlot.get(); - }, + () => storageSlot.get(), () => null, );