react-typing-animation
react-typing-animation copied to clipboard
Conditional children (subtype) expression
Hey,
Cool Library! Thanks! 🥑
So, I've been trying to conditionally render, for instance, the <Typing.Backspace /> and noticed that:
-
if I purposefully render a bool or null to avoid the render phase of the child element, it throws an error related to
struct.typeinutils.js. I believe this function checks for the subtype of Typing but it does not account for this case(?). I haven't looked debugged that part yet. This is merely my suspicion. -
the workaround is, in my case, to render the component but with 0'd out values. I.e
<Typist.Backspace delay={0} count={0} />
The delay does not really matter here, but 🤷♂️
Thanks! Let me know if this makes sense. If desired, it would be my pleasure to continue debugging and submit a pr for that. 👍