rebassjs / rebass

:atom_symbol: React primitive UI components built with styled-system.
https://rebassjs.org
MIT License
7.94k stars 656 forks source link

Use `styled-components` new `shouldForwardProp` API #953

Open karlhorky opened 4 years ago

karlhorky commented 4 years ago

If this is still relevant, to avoid extra props leaking to the DOM and causing warnings, use the shouldForwardProp support that landed in styled-components@5.1.0:

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

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

Related:

cc @mrfelton

colepeters commented 4 years ago

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.