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

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