title: Typing a dynamic tag in React with TypeScript?
body: <p>How do I type a dynamic tag in React with TypeScript? Given this code:</p>
  
  <pre><code>interface CompProps {
    tag: string;
  }
  
  const MyComponent: React.FunctionComponent&lt;CompProps&gt; = ({
    tag = "div",
    children
  }) =&gt; {
    const Wrapper = tag;
  
    return &lt;Wrapper&gt;{children}&lt;/Wrapper&gt;;
  };
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <blockquote>
    <p>Type '{ children: ReactNode; }' has no properties in common with type 'IntrinsicAttributes'. ts(2559)</p>
  </blockquote>
  
  <p>It seems to me I have to add proper types but I cannot figure out which.</p>