Skip to content

Latest commit

History

History
6 lines (5 loc) 路 511 Bytes

2021-02-15.md

File metadata and controls

6 lines (5 loc) 路 511 Bytes
publish_date
2021-02-15
  • 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.