useCallback
useCallback is a React Hook that lets you cache a function definition between re-renders. Call useCallback at the top level of your component to cache a function definition between re-renders: See more examples below. Parameters fn: The function value that you want to cache. It can take any arguments and return any values.
https://beta.reactjs.org/reference/react/useCallback