Search code examples
reactjsionic-frameworkanimationionic-react

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


I am using below code to animate my slider menu as there is no proper example of ionic menu controller for react.

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


            ...my slider UI

</CreateAnimation>

The problem is, it's working fine for first time. but after that It doesn't even after my component re renders.


Solution

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

    sidemenu - A starting project with a side menu with navigation in the content area

    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