使用 react-spring, AnimatedFoo = animated(Foo) 不起作用——或者如何为组件设置动画?
Using react-spring, AnimatedFoo = animated(Foo) doesn't work -- or how to animate a Component?
const AnimatedDonut = animated(Donut)
因为我觉得<animated.div>
可以,但是<animated.Donut>
不行。
所以我尝试了:
https://codesandbox.io/s/weathered-breeze-ghdse
const AnimatedFoo = animated(Foo);
// ....
return <AnimatedFoo style={props}>I will fade in</AnimatedFoo>;
但它没有动画。它应该是它的工作方式吗?
const AnimatedDonut = animated(Donut)
因为我觉得<animated.div>
可以,但是<animated.Donut>
不行。
所以我尝试了:
https://codesandbox.io/s/weathered-breeze-ghdse
const AnimatedFoo = animated(Foo);
// ....
return <AnimatedFoo style={props}>I will fade in</AnimatedFoo>;
但它没有动画。它应该是它的工作方式吗?