Skip to content

Commit

Permalink
BrowserOnly should not return undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Jul 28, 2020
1 parent e1b2963 commit bc45dac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/docusaurus/src/client/exports/BrowserOnly.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()}</>;
Expand Down

0 comments on commit bc45dac

Please sign in to comment.