A

Admin • 833.24K Points
Coach

Q. What is the difference between useEffect and useLayoutEffect?

  • (A) useLayoutEffect fires synchronously after all DOM mutations, useEffect fires asynchronously after paint
  • (B) useEffect is only for class components
  • (C) useLayoutEffect is deprecated
  • (D) There is no difference
  • Correct Answer - Option(A)
  • Views: 28
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin

useLayoutEffect runs before the browser paints, useful for measuring layout.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.