title: How to mock react components with react testing library?
body: <p>I have a react component, which has two children, like this:</p>
  <pre><code>import {Child1} from './child1';
  import {Child2} from './child2';
  ...
  return (
    &lt;&gt;
      &lt;Child1 /&gt;
      &lt;Child2 /&gt;
    &lt;/&gt;
  )
  </code></pre>
  <p>I'm using react <code>testing-library</code> and the app as created with <code>create react app</code> and not ejected.
  I'd like to mock them in my unit test, since they have their own tests, so I'm trying to:</p>
  <pre><code>jest.mock('./child1', () =&gt; 'some mocked string');
  jest.mock('./child1', () =&gt; 'some mocked string');
  </code></pre>
  <p>But when I render it using <code>import { render } from '@testing-library/react';</code> I see the following <code>Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined</code>.</p>
  <p>Why is that and how do I mock those components?</p>