chenglou / react-motion

A spring that solves your animation problems.
MIT License
21.68k stars 1.16k forks source link

Possible to add a linear animation? #554

Closed shallinta closed 6 years ago

shallinta commented 6 years ago

Adding a linear animation will make sense a lot for me.

We may use it like this:

import { Motion, spring, linear } from 'react-motion';
// ...
<Motion
  // ...
  style={{ x: spring(100), y: linear(100) }}
>
// ...

That will be great!

nkbt commented 6 years ago

ReactMotion is based on spring animation and does not do time-based animation. See https://github.com/chenglou/react-motion#faq

shallinta commented 6 years ago

why don't you do that since spring doesn't cover linear?

nkbt commented 6 years ago

Because it is a purpose of this library - to do spring animations. There are a lot of other libs to do time-based animations. Or even just CSS transitions, which you don't need any libraries for.