File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { PostHogProvider as PHProvider } from 'posthog-js/react'
6
6
import { resolveServerPath } from './api/(client)/client'
7
7
import { isDefined } from '@/lib/utils'
8
8
import { usePathname , useSearchParams } from "next/navigation"
9
- import { useEffect } from "react"
9
+ import { useEffect , Suspense } from "react"
10
10
11
11
const POSTHOG_ENABLED = isDefined ( NEXT_PUBLIC_POSTHOG_PAPIK ) && ! NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED ;
12
12
@@ -30,6 +30,12 @@ function PostHogPageView() {
30
30
return null
31
31
}
32
32
33
+ export default function SuspendedPostHogPageView ( ) {
34
+ return < Suspense fallback = { null } >
35
+ < PostHogPageView />
36
+ </ Suspense >
37
+ }
38
+
33
39
export function PostHogProvider ( { children } : { children : React . ReactNode } ) {
34
40
useEffect ( ( ) => {
35
41
if ( POSTHOG_ENABLED ) {
@@ -64,7 +70,7 @@ export function PostHogProvider({ children }: { children: React.ReactNode }) {
64
70
65
71
return (
66
72
< PHProvider client = { posthog } >
67
- < PostHogPageView />
73
+ < SuspendedPostHogPageView />
68
74
{ children }
69
75
</ PHProvider >
70
76
)
You can’t perform that action at this time.
0 commit comments