title: How do I mockImplementation of Jest function mock used for react-i18next useTranslation hook?
body: <p>I have a fairly simple Component, it uses the <code>react-i18next</code> <code>useTranslation</code> hook.</p>
  <p>I had been using the following in a component test. It did as expected by returning the first param <code>key</code> as it's return value.</p>
  <pre class="lang-js prettyprint-override"><code>jest.mock('react-i18next', () =&gt; ({
    useTranslation: () =&gt; ({ t: key =&gt; key }),
  }));
  </code></pre>
  <p>Next I wanted to use a translation that used the built in variable substitution, at this point the above function for <code>t</code> couldn't provide enough data as the second parameter is ignored. So I switched it for a mock function.</p>
  <pre class="lang-js prettyprint-override"><code>const mockTranslation = jest.fn().mockImplementation(key =&gt; key);
  
  jest.mock('react-i18next', () =&gt; ({
    useTranslation: () =&gt; ({ t: mockTranslation }),
  }));
  </code></pre>
  <p>I can confirm that within the component <code>t</code> is definitely a mock function. I can confirm within the test that <code>mockTranslation.mock.calls</code> is picking up all the correct call parameters. It is <strong>not</strong> using the defined implementation to return first param as it's value. <code>mockTranslation.mock.results</code> shows a series of return types that have a value of <code>undefined</code>. I even attempted a basic <code>jest.fn().mockReturnValue('TEST')</code> and still the results show an <code>undefined</code> value.</p>
  <p>I'm not sure what I have done incorrectly here. Can anyone shed some light?</p>