File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments