πŸ“Š React Js
Q. What does `useCallback` hook do?
  • (A) It returns a new function every time
  • (B) It memoizes a function to avoid unnecessary re-creation
  • (C) It creates a new state
  • (D) It modifies context
πŸ’¬ Discuss
βœ… Correct Answer: (B) It memoizes a function to avoid unnecessary re-creation

Explanation: useCallback returns a memoized version of a callback that only changes if dependencies change.

Explanation by: Mr. Dubey
useCallback returns a memoized version of a callback that only changes if dependencies change.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
60
Total Visits
πŸ“½οΈ
9 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
82%
Success Rate