From b1260a6952de4647c4c41785d05d53b280b07f83 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 29 Nov 2024 15:51:39 +0100 Subject: [PATCH] remove useSyncExternalCode temp workaround --- .../docusaurus-theme-common/src/utils/storageUtils.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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, );