We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47766e2 commit 08c01f6Copy full SHA for 08c01f6
components/donate/DonateWrapper.tsx
@@ -1,7 +1,7 @@
1
import classNames from "classnames"
2
import Head from "next/head"
3
import Image from "next/image"
4
-import { useEffect, useState } from "react"
+import { useLayoutEffect, useState } from "react"
5
6
import { Theme } from "../../donate/types"
7
import { isInIframe } from "../../donate/utils"
@@ -25,7 +25,7 @@ export function DonateWrapper({
25
// This is done this way to avoid hydration errors.
26
// See: https://nextjs.org/docs/messages/react-hydration-error
27
const [isClient, setIsClient] = useState(false)
28
- useEffect(() => {
+ useLayoutEffect(() => {
29
setIsClient(isInIframe())
30
}, [])
31
0 commit comments