S
S
sergeyviktorovich2021-11-06 21:49:41
React
sergeyviktorovich, 2021-11-06 21:49:41

How to make an animation when deleting a card?

did so with setTimeout(() , and animation on css , but this is not correct, how to do it without libraries?

deleteTaskItem = () => {
        debugger;
        this.divitem.className = this.divitem.className + " del";
        setTimeout(() => {
            let data = { keychapter: this.state.keychapter, keyitem: this.state.keyitem };
            api.removeTaskItem(data, this.props.dispatch);
        }, 1000);


    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Putin, 2021-11-07
@Ambi2Rush

Alternatively, synthetic events can be used .
In short, an event is suitable onAnimationEndin which you need to pass a callback, which will be executed after the animation is completed. Where and how to add a class with animations is already on your imagination

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question