next-translate: Problem with Page Transitions
Hello,
First, thank you for this amazing library.
Iโm experimenting this issue with any page transitions library eg. next-page-transitions framer-motion etc. Problem is that translation namespace is changed before animation finish:
<PageTransition timeout={1500} classNames='page-transition'>
<Component {...pageProps} key={router.route} />
</PageTransition>
Note*: I set 1500 of delay to make more evident de issue, even without timeout effect is the same.
Is there a way to wait animation finish before load the namespace translation?
Thank you
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 22 (10 by maintainers)
@josegutierro my bad! Just remembered the real fix that worked for me. I found this wrapper online that allows the translations to persist. You should just need to import this hook instead of next-translate, hope it helps.
@josegutierro @haydencleary I did a PR to include this inside the
useTranslation
hook, this way you do not need a workaround.Hello @haydencleary
this works! Thank you so much, you made my day! ๐
This was a mistake, this import can be removed!
@josegutierro @haydencleary already pre-released on 1.0.6-canary.3 ๐ If you can confirm that it works, that would be great