Skip to content

Commit

Permalink
Fix Analytics disabling landing page SSR ✅
Browse files Browse the repository at this point in the history
  • Loading branch information
wotschofsky committed Dec 19, 2023
1 parent df101bd commit 3bf4fb0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/providers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { ThemeProvider } from 'next-themes';
import type { FC, ReactNode } from 'react';
import { type FC, type ReactNode, Suspense } from 'react';
import { SWRConfig } from 'swr';

import Analytics from '@/components/Analytics';
Expand All @@ -15,7 +15,10 @@ const Providers: FC<ProvidersProps> = ({ children }) => (
<SWRConfig
value={{ fetcher: (url) => fetch(url).then((res) => res.json()) }}
>
<Analytics />
<Suspense>
<Analytics />
</Suspense>

{children}
</SWRConfig>
</ThemeProvider>
Expand Down

1 comment on commit 3bf4fb0

@vercel
Copy link

@vercel vercel bot commented on 3bf4fb0 Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.