Answer the question
In order to leave comments, you need to log in
How to add a class to an element and then remove it from the DOM tree without a click in React?
There is a problem with the implementation of the function. We need to add a class
to an existing element ( ) ( say with the name .addClass ) 3 seconds after the page loads, and then completely remove this element from the DOM tree, after 5 seconds, let's say. But to make it all happen without a click.
I understand that for this you need to use the onLoad event, conditions, setTimeout timer-scheduler, but unfortunately I have not come up with anything good yet. <div className="block"></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