当点击按钮 {aa} 时,如何通过 react-spring 隐藏来为 div 制作动画?
https://codesandbox.io/s/silly-feistel-j1snp
const props = useSpring({config: { duration: 1250 },opacity: 1, from: {opacity: 0}});
const foo =() =>{
setAa(!aa)
}
return (
<div className="App">
<div onClick={()=>foo()}>aa</div>
<br/>
{aa &&
<animated.div style={props}>I will fade in</animated.div>}
</div>````