title: styled-component .attrs - React does not recognize prop
body: <p>I am trying to pass down a prop into my styled component. It works as expected, but React throws the known 'Unknown Prop' error.</p>
  
  <p>I tried to use the spread operator at numerous places but neither did work.</p>
  
  <p>The styled component I want to pass down the prop to:</p>
  
  <pre><code>const StyledBackgroundImage = styled(BackgroundImage).attrs(({minHeight}) =&gt; ({
    minHeight: minHeight || "60vh",
  }))`
    min-height: ${({minHeight}) =&gt; minHeight};
    /* ...  */
  `;
  </code></pre>
  
  <p>The parent component:</p>
  
  <pre><code>const ImageWithText = ({imageData, minHeight, children}) =&gt; {
    return (
      &lt;StyledBackgroundImage 
      Tag="div"
      backgroundColor={'#000000'}
      fluid={imageData}
      minHeight={minHeight}
      &gt;
          {children}
      &lt;/StyledBackgroundImage&gt;
    )
  }
  </code></pre>
  
  <p>And how I use it on the page:</p>
  
  <pre><code>&lt;ImageWithText imageData={data.headerBackgroundImage.childImageSharp.fluid} minHeight='50vh'&gt;
  </code></pre>
  
  <p>I expect it to work, which does, but not without the following error:</p>
  
  <pre><code>Warning: React does not recognize the `minHeight` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `minheight` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
      in div (created by BackgroundImage)
      in BackgroundImage (created by Context.Consumer)
      in StyledComponent (created by ImageWithText__StyledBackgroundImage)
      in ImageWithText__StyledBackgroundImage (at ImageWithText.js:32)
      in ImageWithText (at pages/index.js:20)
      in section (created by Context.Consumer)
      in StyledComponent (created by LayoutComponents__Section)
      in LayoutComponents__Section (at pages/index.js:19)
      in main (at layout.js:10)
      in Layout (at pages/index.js:17)
      in IndexPage (created by HotExportedIndexPage)
      in AppContainer (created by HotExportedIndexPage)
      in HotExportedIndexPage (created by PageRenderer)
      in PageRenderer (at json-store.js:93)
      in JSONStore (at root.js:51)
      in RouteHandler (at root.js:73)
      in div (created by FocusHandlerImpl)
      in FocusHandlerImpl (created by Context.Consumer)
      in FocusHandler (created by RouterImpl)
      in RouterImpl (created by Context.Consumer)
      in Location (created by Context.Consumer)
      in Router (created by EnsureResources)
      in ScrollContext (at root.js:64)
      in RouteUpdates (at root.js:63)
      in EnsureResources (at root.js:61)
      in LocationHandler (at root.js:119)
      in LocationProvider (created by Context.Consumer)
      in Location (at root.js:118)
      in Root (at root.js:127)
      in _default (at app.js:65)
  </code></pre>