Languages

React - onTransitionEnd fires multiple times

0 points
Asked by:
Mikolaj
519

Does anyone know why my handleTransitionEnd function is being executed twice after my component changes? How to fix it?

My code:

1 answer
0 points
Answered by:
Zayyan-Todd
860

I found the solution:

  • pass event to the handleTransitionEnd event handling function,
  • insert a simple if statement inside the function so it doesn't take into account one of the properties.

Runnable example:

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join