javascript - Usage of velocity.js animations in React - Stack Overflow

Can i use velocity.js animations within React ponents without integrating it without velocity-react lib

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 badges
Add a ment  | 

1 Answer 1

Reset to default 7

simple example:

  1. import velocity

    import Velocity from 'velocity-animate';
    
  2. 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

相关推荐

  • javascript - Usage of velocity.js animations in React - Stack Overflow

    Can i use velocity.js animations within React ponents without integrating it without velocity-react lib

    5小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信