title: defining props with TypeScript when using higher order component
body: <p>I have a component that needs to get injected from both parent (with PropA) and from HOC (with PropB)</p>
  
  <pre><code>export interface PropsA extends PropsB {
      propA: string;
  }
  
  class SomeComponent extends React.PureComponent&lt;PropsA&gt; {
      render(){
          return (
              &lt;div&gt;
                  {this.props.propA}
                  {this.props.propB}
              &lt;/div&gt;
          );
      }
  }
  
  export default withPropsB(SomeComponent);
  
  
  export interface PropsB {
      propB: string;
  }
  </code></pre>
  
  <p>This is how we inject it with HOC:</p>
  
  <pre><code>export const withPropsB = (Component: any) =&gt; {
      class EnhancedWithProsB extends React.Component&lt;PropsB&gt; {
          render(){
              return &lt;Component {...this.props}/&gt;;
          }
      }
  
      const mapStateToProps = (state: any) =&gt; ({
          propB: "propB"
      });
  
      return connect(mapStateToProps)(EnhancedWithProsB);
  };
  </code></pre>
  
  <p>Client use it this way:</p>
  
  <pre><code>class Wrapper extends React.Component {
      render(){
          return &lt;SomeComponent propA="propA" /&gt;;
      }
  }
  </code></pre>
  
  <p>I got error saying that "Property 'propA' does not exist on type 'IntrinsicAttributes &amp; IntrinsicClassAttributes, ComponentState>> &amp; ...'."</p>
  
  <p>What type should withPropsB method return to make this error dissapear?</p>