react-typist icon indicating copy to clipboard operation
react-typist copied to clipboard

How to set default text (not animated)

Open llibdude opened this issue 3 years ago • 3 comments

I have a use case where I want there to be text already inside Typist so I can then backspace it. I don't want the initial text to be "typed" out.

One thing I tried was to use nested Typist components, where the nested Typist component had 0 typing delays. It almost works but doesn't quite work.

Essentially I want:

<Typist>
  <span>This content is rendered by default without animation.</span>
  <Typist.Backspace count={10} delay={500} />
</Typist>

User would see the sentence and then backspace 10.

My understanding is you can only backspace content that is wrapped by the same Typist component. Is there any mechanism I am missing to accomplish this? Thanks.

llibdude avatar Apr 29 '21 18:04 llibdude

Any updates @llibdude? Did you manage to implement it? I'm running into the same issue

paulphys avatar May 09 '21 12:05 paulphys

I did not manage. In fact the feature was important enough to me that I moved onto another library https://github.com/tameemsafi/typewriterjs. I'm having more success with this library. I very much like the way react-typist works, it's a great library, but I needed the default feature.

I apologize to the authors of this library if it's bad form to link a competing library, but considering there hasn't been development on this library in 2 years and my issue has gone unanswered I'd like to help the community how I can.

llibdude avatar May 11 '21 14:05 llibdude

thanks for your insights. i totally agree with you, it should be fine to advertise a competing library here, since this one seems to be abandoned.

paulphys avatar May 12 '21 15:05 paulphys