Skip to content

function onLoopDone not working until I refresh DOM manually in Next13 #19

@borjamrd

Description

@borjamrd

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",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions