- Learning more about how the
useCallback
react hook works in practice. The first argument is a callback function, the second argument is an array of props or state which the the hook is “watching”, it keeps the current values of this data in memory. Only if the value has changes will the callback function be executed. - Wrap your functions in
React.memo
to ensure that the component only re-renders if the props have changed. This provide a small perfomrance benefit.