react-simple-typewriter
react-simple-typewriter copied to clipboard
function onLoopDone not working until I refresh DOM manually in Next13
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",