Q. What is the difference between useEffect and useLayoutEffect?
β
Correct Answer: (A)
useLayoutEffect fires synchronously after all DOM mutations, useEffect fires asynchronously after paint
Explanation: useLayoutEffect runs before the browser paints, useful for measuring layout.