How can I animate a react.js component onclick and detect the end of the animation

后端 未结 6 1497
孤街浪徒
孤街浪徒 2020-12-28 13:19

I want to have a react component flip over when a user clicks on the DOM element. I see some documentation about their animation mixin but it looks to be set up for \"enter\

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-28 13:55

    I've never used React, but if it uses CSS3 animations/transitions, you might be able to do something like this:

     element.addEventListener( 'webkitTransitionEnd', function( event ) { 
    
       console.log( 'Complete');
    
     }, false );
    

提交回复
热议问题