Answer the question
In order to leave comments, you need to log in
How to reset classes on setState() in React?
Guys, tell me, please, the answer to the following question. I have the following logic:
I fire an event when a button is clicked. On the first and second element of the list, I call animation (add classes). After adding them, I do a setState() and reshape the original array and render again. It is necessary for me that at the same time there were no classes. If you do remove, then they are animated to be removed, which I do not need.
https://codepen.io/gsdev99/pen/qvLerP
The idea behind the animation is to make the first element go into opacity. And the neighbors took his place (animated).
In fact, I want next to work the same as prev.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question