title: For a React + TypeScript variable: enforce some attributes in the "props" of a component
body: <p>I'd like to have a variable (actually function argument, but I simplified the problem) that can hold a React component that MUST have e.g. <code>aNumber: number</code> among it's properties.</p>
  <p>My unsuccesfull try was:</p>
  <pre class="lang-ts prettyprint-override"><code>function MyComp(props: { aNumber: number, aString: string }) {
      return &lt;&gt;{props.aNumber} {props.aString}&lt;/&gt;;
  }
  
  let f2: FunctionComponent&lt;{ aNumber: number }&gt; = MyComp;
  </code></pre>
  <p>giving me the error:</p>
  <pre><code>Type '(props: { aNumber: number; aString: string; }) =&gt; Element' is not assignable to type 'FunctionComponent&lt;{ aNumber: number; }&gt;'.
    Types of parameters 'props' and 'props' are incompatible.
      Property 'aString' is missing in type 'PropsWithChildren&lt;{ aNumber: number; }&gt;' but required in type '{ aNumber: number; aString: string; }'.ts(2322)
  </code></pre>
  <p><code>FunctionComponent</code> is defined in react as:</p>
  <pre class="lang-ts prettyprint-override"><code>    interface FunctionComponent&lt;P = {}&gt; {
          (props: PropsWithChildren&lt;P&gt;, context?: any): ReactElement&lt;any, any&gt; | null;
          propTypes?: WeakValidationMap&lt;P&gt;;
          contextTypes?: ValidationMap&lt;any&gt;;
          defaultProps?: Partial&lt;P&gt;;
          displayName?: string;
      }
  </code></pre>
  <p>I don't understand the error. If I defined a var w/ a constraint to have <code>aNumber</code>, and I assigned to it a richer element =&gt; why isn't it happy? And why it complains about those &quot;richer&quot; attributes?</p>
  <p>Of course, the following works:</p>
  <pre class="lang-ts prettyprint-override"><code>let f1: FunctionComponent&lt;any&gt; = MyComp;
  </code></pre>
  <p>Usually when I try advanced typing constructs in TS, I finally get it working, after a lot of head aches. This time it doesn't seem advanced, but I didn't manage to figure it out.</p>
  <p>Many thanks in advance.</p>