Skip to content

Commit 12be01b

Browse files
committed
set
1 parent 2f08e28 commit 12be01b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/components/Footer/Subscribe/Subscribe.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ export default function Subscribe(props) {
1919
const [email, setEmail] = useState("")
2020
const [customMessage, setCustomMessage] = useState("")
2121
const [emailValid, setEmailValid] = useState(false)
22-
const [key, setKey] = useState(0)
23-
22+
const [mounted, setMounted] = useState(false)
2423

2524
useEffect(() => {
2625
setTimeout(() => {
27-
setKey(key + 1)
28-
}, 100)
26+
setMounted(true)
27+
}, 300)
2928
}, [props.lang])
3029

3130
useEffect(() => {
@@ -48,8 +47,11 @@ export default function Subscribe(props) {
4847
setEmail(e.target.value)
4948
}
5049

50+
if(!mounted) {
51+
return null
52+
}
5153
return (
52-
<div key={key} className={clsx(styles.container, "dark:bg-dark-highlight")}>
54+
<div className={clsx(styles.container, "dark:bg-dark-highlight")}>
5355
<div className={styles.subscribeBox}>
5456
<span className="text-white dark:text-black bg-black dark:bg-white rounded-[50%]">
5557
<SubscribeSvg></SubscribeSvg>

0 commit comments

Comments
 (0)