client reqs
This commit is contained in:
parent
6fbe286ca2
commit
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 { 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>
|
||||
),
|
||||
});
|
||||
import DynamicMainApp from './components/DynamicMainApp';
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<ClientOnly>
|
||||
<MainApp />
|
||||
</ClientOnly>
|
||||
);
|
||||
return <DynamicMainApp />;
|
||||
}
|
Loading…
Reference in New Issue
Block a user