Answer the question
In order to leave comments, you need to log in
Why does React update the state of the images at the same time if it is the same for everyone?
Good evening, tell me please, I have 2 gif pictures - start and stop.
I import them ->
import start from '../../img/start.gif';
import stop from '../../img/stop .gif';
array: [
{name: 'user1', animation: false},
{name: 'user2', animation: true}
],
{this.state.array.map((e, index) => {
i = 'animation' + index
return (
<div key={i} .....
<img src={e.animation ? start : stop} width="20" height="20"/>
</div>
)
})}
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