Skip to content

Commit 996d8e4

Browse files
committed
Try browser only
1 parent 52f98d0 commit 996d8e4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/components/ExamplesPage.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BrowserOnly from '@docusaurus/BrowserOnly';
12
import React, { useEffect, useState } from "react";
23
import Layout from "@theme/Layout";
34

@@ -15,6 +16,16 @@ import {
1516
} from "@fortawesome/free-solid-svg-icons";
1617
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
1718

19+
export default function (props) {
20+
return (
21+
<BrowserOnly fallback={<div>Loading...</div>}>
22+
{() => {
23+
return <ExamplesPage {...props} />;
24+
}}
25+
</BrowserOnly>
26+
);
27+
}
28+
1829
function ExampleLayout({ children }) {
1930
return (
2031
<Layout>
@@ -28,7 +39,7 @@ function ExampleLayout({ children }) {
2839
)
2940
}
3041

31-
export default function ExamplesPage({ examples, example }) {
42+
function ExamplesPage({ examples, example }) {
3243
if (example) {
3344
return (
3445
<ExampleLayout>

0 commit comments

Comments
 (0)