S
S
s243442019-03-23 10:54:07
React
s24344, 2019-03-23 10:54:07

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

1 answer(s)
H
hzzzzl, 2019-03-23
@hzzzzl

Do you really want to apply classes to cells, and not move the entire container?
https://codepen.io/anon/pen/gEqYgp
is not "looped", but somehow you can certainly loop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question