Re:Show HN: React hooks that predict text height before rend...
by pverheggen on Saturday April 04, 2026 @06:16PM
(#47644076)
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.
It's a creative solution though! I always like seeing out of the box thinking on front end problems.