rebass icon indicating copy to clipboard operation
rebass copied to clipboard

Use `styled-components` new `shouldForwardProp` API

Open karlhorky opened this issue 4 years ago • 1 comments

If this is still relevant, to avoid extra props leaking to the DOM and causing warnings, use the shouldForwardProp support that landed in [email protected]:

https://github.com/styled-components/styled-components/releases/tag/v5.1.0

Original PR: https://github.com/styled-components/styled-components/pull/3006

Related:

  • Potentially related to styled-system issue: https://github.com/styled-system/styled-system/issues/1253
  • Related: https://github.com/rebassjs/rebass/issues/571#issuecomment-479951245

cc @mrfelton

karlhorky avatar Apr 07 '20 09:04 karlhorky

With Styled Components 5.1 out, I'm currently trying to integrate the props export from @styled-system/should-forward-prop into a utility in my company's component library (which uses Styled Components) to keep style props from passing into the DOM.

I'd be happy to open a PR here to include the utility (and a create… version as is currently available for Emotion) for styled-components, but I'm not sure what the export would be. The default export for this package is for Emotion, but both libraries use an API named shouldForwardProp, each with a different interface.

@jxnblk any ideas? Seems like a breaking change for this package would be inevitable given the naming issue.

colepeters avatar Sep 15 '20 16:09 colepeters