Should I wrap all functions that defined in component in useCallback?
问题 As far as I've known, functions that defined in a React's functional component are regenerated whenever the component rerenders. Since useCallback can be triggered by specific dependencies, it prevents unnecessary regeneration of these functions. Should I wrap each of them in useCallback, and pass relevant dependencies? import React from 'react' const Comp = () => { const fn1 = useCallback( ()=>{ // do something }, [dependency1]) const fn2 = useCallback( ()=>{ // do something },