From bc45dac1dbd475f2f4e61d4cb1099754f705565d Mon Sep 17 00:00:00 2001 From: slorber Date: Tue, 28 Jul 2020 20:07:19 +0200 Subject: [PATCH] BrowserOnly should not return undefined --- 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()};