react-typing-animation icon indicating copy to clipboard operation
react-typing-animation copied to clipboard

Conditional children (subtype) expression

Open wallycarvalho opened this issue 6 years ago • 0 comments

Hey,

Cool Library! Thanks! 🥑

So, I've been trying to conditionally render, for instance, the <Typing.Backspace /> and noticed that:

  1. if I purposefully render a bool or null to avoid the render phase of the child element, it throws an error related to struct.type in utils.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.

  2. 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. 👍

wallycarvalho avatar Feb 26 '19 01:02 wallycarvalho