title: Can I use useCallback or useMemo to cache the result of my function?
body: <p>Let's say there is a function inside a component, for example like this:</p>
  
  <pre><code>     const MyComponent = ({data}) =&gt; {
         const myFunction = a =&gt; a+1;
         return &lt;div&gt;
                    data.map(num =&gt; myFunction(num))
                &lt;/div&gt;
       }
  </code></pre>
  
  <p>I don't want <strong>myFunction()</strong> to be called again if it already has been called with the same argument.
  What is the best practice to add caching here?</p>