react-simple-typewriter icon indicating copy to clipboard operation
react-simple-typewriter copied to clipboard

function onLoopDone not working until I refresh DOM manually in Next13

Open borjamrd opened this issue 10 months ago • 1 comments

Hi, I'm facing the following issue:

I've set useState hook in order to render an array of items after writting effect, so onLoopDone mush call the handleCards function after loop ends, but it's not working.

const [cards, setCards] = useState<boolean>(false);
  function handleCards() {
    console.log("works!");
    setCards(true);
  }
<Typewriter
          words={[text]}
          loop={1}
          typeSpeed={10}
          onLoopDone={handleCards}
          deleteSpeed={10}
        />
        <Cursor />

Dependencies: "next": "13.4.10",
"react-dom": "18.2.0",

borjamrd avatar Aug 19 '23 17:08 borjamrd