logoalt Hacker News

recursive01/20/20252 repliesview on HN

The loaders should be able to animate with buttery smoothness. On this 5-year-old laptop running firefox on windows, the loader animations are prone to stuttering jank. Perhaps this is just the nature of running an animation through a react reconciler, but also these loaders should be able to go around react without invoking a render function or reconciler.


Replies

kadoban01/21/2025

It is indeed using javascript to do those parts, eg https://github.com/internet-development/www-sacred/blob/4454... .

My limited JS and React knowledge says that CSS is the right way to do most of that, or if that's not possible I think JS's requestAnimationFrame. React doesn't seem to be necessarily the issue here, though it may not be helping.

show 1 reply
sesm01/21/2025

In React animations shouldn't run through reconciler, variables for JS animation should use `refs` which are mutable variables outside of React state. React supported `refs` for cases like this long before hooks were introduced.