Open AlexString opened 1 year ago
I agree, the component is awesome but should react to sequence changes and re-render the components.
@AlexString thanks for the workaround!
I thinks we can using the key
prop for remount component, just naming value for each language code, that works for me.
return (<TypeAnimation
key={lang} // lang is current language
cursor={cursor}
sequence={sequence}
speed={30}
wrapper={wrapper}
className={className}
/>)
@maxeth may you update docs at Hot Reload not supported ? for how to remount the component, thanks you.
@htranq what is the difference between this method vs the OP method? Certainly yours is cleaner but I wonder if there's any performance difference.
As it is mentioned in the Usage Notes
I'm using this nice package in a website where switching between languages is involved so I needed to change sequence on language change.
I made this workaround to achieve this and I hope this helps someone who is looking for something similar.
And I'm using it like so: