Compare commits
2 Commits
8ad31ec05c
...
e3aed97b22
Author | SHA1 | Date | |
---|---|---|---|
e3aed97b22 | |||
3a19a84962 |
22
app/components/DynamicMainApp.tsx
Normal file
22
app/components/DynamicMainApp.tsx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
|
import { Center, Spinner } from '@chakra-ui/react';
|
||||||
|
import ClientOnly from './ClientOnly';
|
||||||
|
|
||||||
|
const MainApp = dynamic(() => import('./MainApp'), {
|
||||||
|
ssr: false,
|
||||||
|
loading: () => (
|
||||||
|
<Center h="100vh">
|
||||||
|
<Spinner size="xl" />
|
||||||
|
</Center>
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default function DynamicMainApp() {
|
||||||
|
return (
|
||||||
|
<ClientOnly>
|
||||||
|
<MainApp />
|
||||||
|
</ClientOnly>
|
||||||
|
);
|
||||||
|
}
|
19
app/page.tsx
19
app/page.tsx
@ -1,20 +1,5 @@
|
|||||||
import dynamic from 'next/dynamic';
|
import DynamicMainApp from './components/DynamicMainApp';
|
||||||
import { Center, Spinner } from '@chakra-ui/react';
|
|
||||||
import ClientOnly from './components/ClientOnly';
|
|
||||||
|
|
||||||
const MainApp = dynamic(() => import('./components/MainApp'), {
|
|
||||||
ssr: false,
|
|
||||||
loading: () => (
|
|
||||||
<Center h="100vh">
|
|
||||||
<Spinner size="xl" />
|
|
||||||
</Center>
|
|
||||||
),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return <DynamicMainApp />;
|
||||||
<ClientOnly>
|
|
||||||
<MainApp />
|
|
||||||
</ClientOnly>
|
|
||||||
);
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user