Skip to content

Commit 22d79d7

Browse files
committed
save
1 parent 51cadc5 commit 22d79d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/Footer/Subscribe/Subscribe.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ 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)
2223

2324
useEffect(() => {
2425
i18next.changeLanguage(props.lang)
26+
const timer = setTimeout(() => {
27+
setKey(prev => prev + 1)
28+
}, 300)
29+
return () => clearTimeout(timer)
2530
}, [props.lang])
2631

2732
useEffect(() => {
@@ -45,7 +50,7 @@ export default function Subscribe(props) {
4550
}
4651

4752
return (
48-
<div key={props.lang} className={clsx(styles.container, "dark:bg-dark-highlight")}>
53+
<div key={key} className={clsx(styles.container, "dark:bg-dark-highlight")}>
4954
<div className={styles.subscribeBox}>
5055
<span className="text-white dark:text-black bg-black dark:bg-white rounded-[50%]">
5156
<SubscribeSvg></SubscribeSvg>

0 commit comments

Comments
 (0)