A

Admin • 828.03K Points
Coach

Q. Which hook should you use to access the previous state value?

  • (A) useRef
  • (B) usePrevious (custom hook)
  • (C) useState
  • (D) useEffect
  • Correct Answer - Option(B)
  • Views: 13
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin
React does not provide usePrevious natively, but it can be created using useRef.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.