7 pointsby ahmadparizaad10 hours ago2 comments
  • pverheggen3 hours ago
    FYI, useLayoutEffect gets you what you're looking for. Since it fires before repaint, you can take measurements and modify the DOM without the user seeing any layout shift.

    It's a creative solution though! I always like seeing out of the box thinking on front end problems.

  • kraftaa4 hours ago
    Neat. Have you seen differences across browsers? Feels like the hard part here is more about matching browser quirks over time than about math.