Can i use velocity.js animations within React ponents without integrating it without velocity-react library ? I don't like that by default, when the ponent is mounted, the final state of the animation is shown. How can i make animation to run on ponent load ?
Can i use velocity.js animations within React ponents without integrating it without velocity-react library ? I don't like that by default, when the ponent is mounted, the final state of the animation is shown. How can i make animation to run on ponent load ?
Share Improve this question edited Sep 2, 2016 at 11:38 Ivica Obadic asked Sep 2, 2016 at 11:02 Ivica ObadicIvica Obadic 751 silver badge10 bronze badges1 Answer
Reset to default 7simple example:
import velocity
import Velocity from 'velocity-animate';
then start animation in ponentDidMount
import React, { Component } from 'react'; class VelocityExample extends Component { ponentDidMount(){ Velocity(this.refs.block,{ scale: 2 },500) .then(e=>console.log('animation plete')) } render(){ return <div ref="block" >VelocityExample</div>; } }
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745198189a4616193.html
评论列表(0条)