Subjects

All subjects Django Java Python React Spring Boot JavaScript PHP
Sign Up Free
Interview question

What is useCallback and why is it useful? useCallback क्या है और यह क्यों उपयोगी है?

Answer
const fn = useCallback(() => doSomething(id), [id]);

useCallback memoizes function references to reduce unnecessary child re-renders.

const fn = useCallback(() => doSomething(id), [id]);

useCallback function references को memoize करता है।

Was this answer clear?