React Code Completion Medium +20 XP
useCallback Hook
Complete to memoize the handler.
ReactFill in the blank
const handleClick = ___(()=> {
doSomething();
}, []);Type the missing code
Show answer and explanation
Answer: useCallback
useCallback memoizes a function so it isn't recreated on every render, useful for child component optimization.
Hint: Which hook memoizes functions?
What this challenge tests
Code Completion in React: hooks, performance.