jasonslyvia / react-marquee

A <marquee> component for React
81 stars 33 forks source link

Maybe translate3d() has better performance than simple position right? #6

Open jackey opened 7 years ago

jackey commented 7 years ago

how about this one ?

    const style = {
      //'position': 'static',
      'position': 'relative',
      'display': 'inline-block',
      //'right': this.state.animatedWidth,
      'transform': `translate3d(-${this.state.animatedWidth}px, 0px, 0px)`,
      'whiteSpace': 'nowrap'
    };
jasonslyvia commented 7 years ago

It is better indeed, this repo was built under the consideration of legacy browser support, so I choose setTimeout. You're very welcome to send some PRs to make it happen.

erikhuisman commented 7 years ago

Only measureText on render receiving props would help too