ionic-react 如何在组件重新渲染时使用 <CreateAnimation> 设置动画?

ionic-react how to animate with <CreateAnimation> on component re render?

我正在使用下面的代码来制作我的滑块菜单的动画,因为没有合适的反应离子菜单控制器示例。

<CreateAnimation
            play={isLoaded}
            duration={500}
            fromTo={[
                { property: 'transform', fromValue: animateFrom, toValue: animateTo }
            ]}>


            ...my slider UI

</CreateAnimation>

问题是,它第一次运行良好。但在那之后它甚至在我的组件重新渲染之后也没有。

https://ionicframework.com/docs/cli/commands/start

sidemenu - 一个带有侧面菜单的起始项目,在内容区域有导航

Starters for @ionic/react (--type=react)

name         | description
--------------------------------------------------------------------------------------
blank        | A blank starter project
list         | A starting project with a list
my-first-app | An example application that builds a camera with gallery
sidemenu     | A starting project with a side menu with navigation in the content area
tabs         | A starting project with a simple tabbed interface
conference   | A kitchen-sink application that shows off all Ionic has to offer