Skip to content

Commit

Permalink
fix(v2): BrowserOnly should not return undefined (#3149)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Jul 28, 2020
1 parent eeb5c93 commit d28a29f
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 d28a29f

Please sign in to comment.