11 Matching Annotations
  1. Oct 2020
  2. Sep 2020
  3. Jul 2020
    1. wrapping every callback function inside useCallback(): import React, { useCallback } from 'react'; function MyComponent() { const handleClick = useCallback(() => { // handle the click event }, []); return <MyChild onClick={handleClick} />; } “Every callback function should be memoized to prevent useless re-rendering of child components which use the callback function” is the reasoning of his teammates. This statement is far from the truth. Moreover, such usage of useCallback() makes the component slower, harming the performance.
  4. Oct 2019