title: PropTypes for NextJS Image Component
body: <p>I am including the new <a href="https://nextjs.org/docs/api-reference/next/image" rel="nofollow noreferrer">Next.js Image component</a> inside of another component like this:</p>
  <pre><code>import PropTypes from &quot;prop-types&quot;;
  import Image from &quot;next/image&quot;;
  
  const Pattern = ({ classes, src, alt, width, height, layout }) =&gt; (
    &lt;div className={classes.wrapper}&gt;
      &lt;Image
        src={src}
        alt={alt}
        width={width}
        height={height}
        layout={layout}
        className={classes.img}
      /&gt;
    &lt;/div&gt;
  );
  
  Pattern.propTypes = {
    classes: PropTypes.shape({
      wrapper: PropTypes.string,
      img: PropTypes.string,
    }),
    src: PropTypes.string,
    alt: PropTypes.string,
    layout: PropTypes.string
  };
  
  export default Pattern;
  </code></pre>
  <p>As you see, we are using <code>prop-types</code>.  What I am having trouble figuring out is what prop type to set for width and height. Here is a sample usage of the Image component from the Next.js documentation:</p>
  <pre><code>&lt;Image
    src=&quot;/me.png&quot;
    alt=&quot;Picture of the author&quot;
    width={500}
    height={500}
  /&gt;
  </code></pre>
  <p>I am not sure how to set this. <code>PropTypes.number</code>? <code>PropTypes.object</code>?  Something else?</p>