mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-07 22:27:11 +02:00
fix(v2): BrowserOnly should not return undefined (#3149)
This commit is contained in:
parent
eeb5c93e15
commit
d28a29f2c9
1 changed files with 2 additions and 2 deletions
|
@ -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()}</>;
|
||||
|
|
Loading…
Add table
Reference in a new issue