React-Move – Animate anything in React
github.com
github.com
Examples:
https://www.webpackbin.com/bins/-KfKys3S2mgEH9UsE8GL
http://react-springy-parallax.surge.sh/
API examples:
It seems like it's because there's been zero documentation on it?
How am I supposed to find out about this library and that it can be used in regular React? When I search for "react animated" the only official docs I get are https://facebook.github.io/react/docs/animation.html, which are now deprecated and have no relation to react-native-animated.
The official documentation for react-native-animated at https://facebook.github.io/react-native/docs/animated.html don't mention anything about web components (eg. Animated.div) -- they only mention native components: https://facebook.github.io/react-native/docs/animated.html#a...
So I guess my questions are: how do I find out about regular, official React libraries like this? And how do I know this isn't an internal library that won't be changed at some point?
[1] https://github.com/animatedjs/animated#usage-still-theoretic...
In the webpackbin it demonstrates the use if you want to test it. You install it with: npm install animated --save
['red', 'blue', 'yellow'].find((d, i) => i === Math.round(Math.random() * 2))
That's not a safe way to pick a random color from an array.`Math.round(Math.random() * 2)` might produce the following sequence: 2, 2, 0. The find callback is called with 0, 1, 2, so it returns nothing.
Maybe they were going for:
['red', 'blue', 'yellow'][Math.round(Math.random() * 2)]
If they intended for `undefined` or `null` to be a valid result, then it would be better to write: ['red', 'blue', 'yellow', null][Math.round(Math.random() * 3)]
Haha, I submitted a PR: https://github.com/tannerlinsley/react-move/pull/1`|0` is a good trick, I'll have to remember that.
I wouldn't recommend using this unless you're trying to shove milliseconds in this type of operations.
react-motion: https://github.com/chenglou/react-motion
This sort of declarative transition comes in handy for us all the time. Two features I don't see yet in React-Move that we find useful is a prop for more precise control over the staggering (orderBy), and custom interpolation (interpolate).
(an aside, but boasting about a 12KB minified size for an animation library baffles me. That's huge!)
Use the d3 stuff directly, or a good tweening library that is well-suited and hardware accelerated for your platform.
On the topic of hardware acceleration, there are a some good perks to using class-based/keyframe CSS animation, but you immediately forfeit any ability to utilize dynamic run-time values. It's also important to note that even though React-Move's animation loop is being executed in Javascript instead of the browser's GPU thread, doesn't mean React-Move doesn't utilize hardware acceleration. By mapping these interpolated values to hardware-accelerated css properties, you are in fact using hardware-accelerated transitions, albeit at the speed of the JS thread.
If all of these amazing features aren't your cup of tea, then I would most definitely suggest that you roll your own solution. :)
Cheers!
Feel free to wire together your own solution if that works better for you. As for me, react-move is exactly what I need.
It's certainly an evolving product and not every native function (such as video recording) is available as an easy-to-use component. In those cases, you can use a 3rd party NPM component or write your own Java/ObjC and link it in with your own custom component. Even if you have to write a little bit of Java/ObjC, it's a huge time saver.
Animation stuff in Redux state would not be as nice.
God dammit.