title: React TypeScript hoisting statics with a higher-order component
body: <p>I'm trying to port my project from JavaScript to TypeScript. I have a higher-order higher-order component called <code>hoistStatics</code>, which can take in a HOC and hoist the statics of the wrapped component</p>
  <pre><code>import hoistNonReactStatics from 'hoist-non-react-statics';
  
  export const hoistStatics = higherOrderComponent =&gt; BaseComponent =&gt; {
    const NewComponent = higherOrderComponent(BaseComponent);
    hoistNonReactStatics(NewComponent, BaseComponent);
    return NewComponent;
  };
  </code></pre>
  <p>My problem, is I have no idea how to type this. Is there a way to type a generic higher-order component? How would I have to deal with props in this case?</p>