title: React component type in TypeScript
body: <p>What is the correct way to describe the type of a react component in TypeScript?
  Say we have a function which returns a react component.
  The function:</p>
  
  <pre><code>const getTabContent: () =&gt; ReactElement = () =&gt; {
    switch (tab) {
      case 1:
        return &lt;Images images={images} onSelect={onSelect}/&gt;;
      default:
        return &lt;Search onSelect={onSelect}/&gt;;
    }
  };
  </code></pre>
  
  <p>Here I describe the returning type as <strong>ReactElement</strong>, but I'm wondering whether it's correct or I should describe it as <strong>ReactComponentElement</strong> or even somehow completely differently?
  Also those both types are generics and how to fully describe them if one of them is correct?</p>
  
  <p>UPD ReactElement seems to fit here, because, for example, FC (FunctionComponent) returns it</p>