typewriterjs icon indicating copy to clipboard operation
typewriterjs copied to clipboard

Callback runs twice with NextJS?

Open vincepolston opened this issue 2 years ago • 2 comments

Didn't see this question asked elsewhere. It appears that the callFunction runs twice.

<Typewriter
onInit={(typewriter) => {
    typewriter.typeString("Welcome to Dev Diaries...")
    .pauseFor(1000)
    .deleteAll()
    typewriter.typeString("The podcast for developers and technical founders.")
    .pauseFor(1500)
    .deleteAll()
    typewriter.typeString("Launching January 2023. Join us..")
    .pauseFor(1500)
    .callFunction(() => {

        console.log('finished typewriter text...')

    })
    .start();
}}
/>

The above code results in the console log spitting out the text twice. I've also tried creating a function and calling it within the .callFunction which also results in it being run twice. Thoughts? Thanks in advance. Great library.

vincepolston avatar Sep 13 '22 17:09 vincepolston

I also have this issue. Did you find a fix?

HakonHarnes avatar Oct 07 '22 12:10 HakonHarnes

Unfortunately I have not. It's a strange one.

vincepolston avatar Oct 07 '22 12:10 vincepolston