title: PropTypes.oneOfType not working as I expect with TypeScript
body: <p>I want to allow a component to have one of different possible actions. I am using <code>PropTypes.oneOfType</code> to do this.</p>
  
  <p>When I use <code>PropTypes.inferTypes</code> to deduce types in TypeScript I get a compilation error.</p>
  
  <pre><code>import React from "react";
  import PropTypes, { InferProps } from "prop-types";
  
  const Action1 = PropTypes.shape({
    type: PropTypes.oneOf(["action1"]).isRequired,
    string1: PropTypes.string.isRequired
  });
  
  const Action2 = PropTypes.shape({
    type: PropTypes.oneOf(["action2"]).isRequired,
    string1: PropTypes.string.isRequired,
    string2: PropTypes.string.isRequired
  });
  
  const ActionType = {
    action: PropTypes.oneOfType([Action1, Action2])
  };
  
  export const ActionComponent = (
    props: InferProps&lt;typeof ActionType&gt;
  ): JSX.Element =&gt; {
    return &lt;p&gt;{props}&lt;/p&gt;;
  };
  
  ActionComponent.propTypes = ActionType;
  
  const a = &lt;ActionComponent action={{ type: "action1", string1: "bye" }} /&gt;;  // ok
  const b = (
    &lt;ActionComponent
      action={{ type: "action2", string1: "bye", string2: "test" }}  // string2 not ok
    /&gt;
  );
  </code></pre>
  
  <p>The error I get is </p>
  
  <pre><code>Type '{ type: string; string1: string; string2: string; }' is not assignable to type 'InferProps&lt;{ type: Validator&lt;string&gt;; string1: Validator&lt;string&gt;; }&gt;'.
    Object literal may only specify known properties, but 'string2' does not exist in type 'InferProps&lt;{ type: Validator&lt;string&gt;; string1: Validator&lt;string&gt;; }&gt;'. Did you mean to write 'string1'?  TS2322
  </code></pre>
  
  <p>This may be a simple mistake, but I can't figure it out.</p>