useEffect runs after the browser paints. If you manipulate the DOM (like positioning a tooltip) inside it, the user might see a flicker or jump. useLayoutEffect runs before paint.
Tooltip component where the tooltip flickers briefly at (0,0) before jumping to the correct positionuseEffect to useLayoutEffect to block painting until the position is calculatedSubmit your code to see test results