mirror of
https://github.com/audacity/audacity.github.io.git
synced 2026-04-13 15:35:01 -05:00
stop page from jumping during load #11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LWinterberg on GitHub.
our react components (in particular releasevideo.jsx and shareyoursounds.jsx) currently determine their size after the initial render, causing pages to shift. pagespeed.web.dev doesn't like that and fails us for the core web vitals which allegedly is an SEO factor.
https://web.dev/articles/cls
We possibly can fix this by using useLayoutEffect in the elements in question so the size is there before any painting happens. In practice, I've only been able to make the stuff inside the thing load together with the element, not the other way round.
https://react.dev/reference/react/useLayoutEffect
@LWinterberg commented on GitHub:
on further inspection, it seems like changing
client:onlytoclient:loadfixes the thing from jumping about. @DilsonsPickles any reason we need client:only rendering? from the looks of it, the download button points to the /download before the JS loads in, which is fine in my eyes