typewriterjs
typewriterjs copied to clipboard
Why clearing text in the end by default?
Hey, I was wondering why the default behavior is to clear the text after typing. Wouldn't it make more sense to keep the typed text by default? I don't see why you would clear after typing the last word...
options={{
strings: ["hello", "world"],
autoStart: true,
}}
check what the string data is it object or array if it's object but you declare the strings:[] then it causing the problem if you using vanilla js loop: false should be pervent the clearance effect here is mine example { TypingComponent ? ( <Typewriter options={{ autoStart: true, loop: false, delay: 20, strings: description, }} /> ) : ( description ) }
I have a basic component wrapper I made and followed this advice @wibawasuyadnya and still have the problem of the last message getting deleted.
const TypewriterHero = ({ messages }) => (
<Typewriter
options={{
autoStart: true,
loop: false,
delay: 35,
strings: messages,
}}
/>
);
You're saying it doesn't work when you set strings with a sequential object?
I agree 1000%. This is a cool library, but why on earth does it delete your text after it renders? I can't find an option to disable that behavior in options, too bad, will have to build this custom.
Edit: Here's a workaround: https://github.com/tameemsafi/typewriterjs/issues/214