Skip to content

Commit ec92234

Browse files
committed
use dynamic to prevent ssr
1 parent 654b12b commit ec92234

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

apps/postgres-new/components/providers.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
55
import { PropsWithChildren } from 'react'
66
import AppProvider from './app-provider'
77
import { ThemeProvider } from './theme-provider'
8-
import { DatabaseLocksProvider } from '~/lib/database-locks'
98

109
const queryClient = new QueryClient()
1110

11+
import dynamic from 'next/dynamic'
12+
13+
const DatabaseLocksProvider = dynamic(
14+
async () => (await import('~/lib/database-locks')).DatabaseLocksProvider,
15+
{
16+
ssr: false,
17+
}
18+
)
19+
1220
export default function Providers({ children }: PropsWithChildren) {
1321
return (
1422
<ThemeProvider attribute="class" defaultTheme="system" disableTransitionOnChange>

0 commit comments

Comments
 (0)