For most synchronization tasks that do not require pre-paint layout work, useEffect is the better default.
Question 5 of 20 in useLayoutEffect Quiz