title: Typing props spread when using InferProps<> from prop-types
body: <p>I'd like to preserve proptypes in my typescript react project (to provide runtime prop type-checking). I would only like to type props once however, so I'm using <code>InferProps</code> from <code>prop-types</code>. How do I correctly type spread props in this scenario? The compiler rightly complains here that <code>Property 'type' does not exist on type '{}'</code>. It is okay for <code>props.type</code> to be undefined in this context.</p>
  <pre class="lang-js prettyprint-override"><code>const propTypes = {
    component: PropTypes.any,
    name: PropTypes.string.isRequired,
    value: PropTypes.string,
  };
  
  const FormikField = ({
    component: Component = Input,
    name,
    value,
    ...props
  }: InferProps&lt;typeof propTypes&gt;): JSX.Element =&gt; {
    const [field, meta] = useField({ name, type: props.type, value });
    return (
      &lt;Component
        error={meta.touched ? meta.error : null}
        {...field}
        {...props}
      /&gt;
    );
  };
  
  FormikField.propTypes = propTypes;
  </code></pre>