Hacker News new | ask | show | jobs
by hazza1 2930 days ago
fetch and CSS handle AJAX and animation absolutely fine with native calls and work well with React, why would you bring in a library to handle these?
1 comments

You bring animation libraries in when your UI animations don't necessarily match the component lifecycles and you don't want to do something basic. Well, you don't have to bring in animation libraries but then you'll have to engineer it by yourself and handle all the quirks.

In React you simulate a DOM(or whatever) instead of working on a DOM that's handled by the browser(or whatever).

It's just like the difference of a real-world physics and simulated physics. In the real world, you can throw a rock and the nature will handle everything. On a simulation, you will have to think about all kind of details to make your simulation as realistic as possible.

I don't really see how complex animations is something React (or any UI framework) should be responsible for ?
Who should be responsible if not the UI framework?

Oh, and by complex, I don't mean character animation or something. It's the stuff that is supposed to act differently than the React's internal workings.

For example, if you want to do an animation on items that disappear when the user takes an action it's not going to be easy as with plane JS manipulating the DOM. Also, you won't be able to use some nice artistic animations that were created by direct DOM manipulation.