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

  • (A) useRef
  • (B) usePrevious (custom hook)
  • (C) useState
  • (D) useEffect
πŸ’¬ Discuss
βœ… Correct Answer: (B) usePrevious (custom hook)
Explanation: React does not provide usePrevious natively, but it can be created using useRef.
Explanation by: Mr. Dubey
React does not provide usePrevious natively, but it can be created using useRef.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
64
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
89%
Success Rate