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
In most cases, DOM operations are not required, use
React Add-Ons
的ReactCSSTransitionGroup
组件或ReactTransitionGroup
components:React animation
You can reference jq in componentDidMount in the react component and then write the animation