From d28a29f2c9005412b2e42a36fda4c7f6f5524dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Tue, 28 Jul 2020 20:17:47 +0200 Subject: [PATCH] fix(v2): BrowserOnly should not return undefined (#3149) --- packages/docusaurus/src/client/exports/BrowserOnly.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus/src/client/exports/BrowserOnly.tsx b/packages/docusaurus/src/client/exports/BrowserOnly.tsx index b3492cfcc8bb..417c3cbb124e 100644 --- a/packages/docusaurus/src/client/exports/BrowserOnly.tsx +++ b/packages/docusaurus/src/client/exports/BrowserOnly.tsx @@ -14,9 +14,9 @@ function BrowserOnly({ }: { children?: () => JSX.Element; fallback?: JSX.Element; -}): JSX.Element | undefined { +}): JSX.Element | null { if (!ExecutionEnvironment.canUseDOM || children == null) { - return fallback || undefined; + return fallback || null; } return <>{children()};