styled-components/styled-components
### [`v5.1.0`](https://togithub.com/styled-components/styled-components/blob/master/CHANGELOG.md#v510---2020-04-07)
[Compare Source](https://togithub.com/styled-components/styled-components/compare/v5.0.1...v5.1.0)
##### New Functionality
- Add `shouldForwardProp` API (almost the same as emotion's, just a slightly different usage pattern); [#3006](https://togithub.com/styled-components/styled-components/pull/3006)
Sometimes when composing multiple higher-order components together, it's possible to get into scenarios when multiple layers consume props by the same name. In the past we've introduced various workarounds for popular props like `"as"` but this power-user API allows for more granular customization of what props are passed down to descendant component children when using the `styled()` HOC wrapper.
When combined with other APIs like `.attrs()` this becomes a very powerful constellation of abilities.
Here's how you use it:
```jsx
const Comp = styled('div').withConfig({
shouldForwardProp: (prop, defaultValidatorFn) => !['filterThis'].includes(prop),
})`
color: red;
`;
render();
```
Renovate configuration
:date: Schedule: At any time (no schedule defined).
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
:ghost: Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
5.0.1
->5.1.0
5.0.1
->5.1.0
Release Notes
styled-components/styled-components
### [`v5.1.0`](https://togithub.com/styled-components/styled-components/blob/master/CHANGELOG.md#v510---2020-04-07) [Compare Source](https://togithub.com/styled-components/styled-components/compare/v5.0.1...v5.1.0) ##### New Functionality - Add `shouldForwardProp` API (almost the same as emotion's, just a slightly different usage pattern); [#3006](https://togithub.com/styled-components/styled-components/pull/3006) Sometimes when composing multiple higher-order components together, it's possible to get into scenarios when multiple layers consume props by the same name. In the past we've introduced various workarounds for popular props like `"as"` but this power-user API allows for more granular customization of what props are passed down to descendant component children when using the `styled()` HOC wrapper. When combined with other APIs like `.attrs()` this becomes a very powerful constellation of abilities. Here's how you use it: ```jsx const Comp = styled('div').withConfig({ shouldForwardProp: (prop, defaultValidatorFn) => !['filterThis'].includes(prop), })` color: red; `; render(Renovate configuration
:date: Schedule: At any time (no schedule defined).
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
:ghost: Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by WhiteSource Renovate. View repository job log here.