Chapter 12 · Example 3 · Escaping Flickering UI with useLayoutEffect

Blocking synchronous painting

Changing an element border three times with synchronous delays in one task stops the browser painting until the end, so only the final black border appears.

Loading live editor…