State updates scheduled inside useLayoutEffect are flushed before paint, allowing a second render that the user does not see halfway.
Question 8 of 20 in useLayoutEffect Quiz