title: My react component written in typescript does not accept children
body: <p>This is the error TypeScript (Version 3.9.2) gives me:</p>
  
  <p><code>Error:(24, 21) TS2559: Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes &amp; Pick&lt;ClassAttributes&lt;ComponentClass&lt;Pick&lt;MyComponentPropsType, ...&gt;, any&gt; &amp; WithRouterStatics&lt;typeof MyComponent&gt;&gt; &amp; Pick&lt;...&gt;, "ref" | "key"&gt;'.</code></p>
  
  <p>Code of the component:</p>
  
  <pre><code>interface MyComponentPropsType{
      location: any,
      match: any,
      history: any
  }
  
  class MyComponent extends Component&lt;MyComponentPropsType&gt;{
    // do some stuff
    render(){
      return &lt;div&gt;{this.props.children}&lt;/div&gt;;
    }
  }
  export default connect(mapStateToProps, mapDispatchToProps)(withRouter(MyComponent));
  </code></pre>
  
  <p>Usage of said component somewhere else:</p>
  
  <pre><code>&lt;MyComponent&gt;&lt;AnotherComponent&gt;&lt;/MyComponent&gt;
  </code></pre>
  
  <p>The weird thing is, the error pops up only sometimes.
  There are times typescript compiles perfectly and sometimes it doesn't.</p>