javascript - How to write animation effects in react?
世界只因有你
世界只因有你 2017-05-18 10:58:34
0
2
752

How to write animation effects for components in react? For example, for a simple dialog box, I hope that after clicking Cancel, the dialog box will first fade and then disappear.
If you use jquery, it is very simple, first animate({ //Fade CSS}, function(){ //Delete DOM}).

But react, I don’t know how to do it. Could it be that the entire component dom exists, and only a CSS animation is used to switch the display and hide?

Please give me some advice

世界只因有你
世界只因有你

reply all(2)
Ty80

In most cases, DOM operations are not required, use React Add-OnsReactCSSTransitionGroup组件或ReactTransitionGroupcomponents:

  • React animation

曾经蜡笔没有小新

You can reference jq in componentDidMount in the react component and then write the animation

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template