forbid-component-props should have a component whitelist
See original GitHub issueFor custom components it makes sense to have the rule, but when using third-party components violating the rule (ReactModal
using className
is probably one of the more prominent examples) there isn’t much you can do about it…
Having to add eslint-disable react/forbid-component-props
comments isn’t a very pretty solution.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
JS.REACT.FORBID.COMPONENT.PROPS
Forbid certain props on Components (react/forbid-component-props) ... specifying the property name, an optional custom message, and a component whitelist:
Read more >How to fix "Prop spreading is forbidden" in specialized ...
An alternative might be to pick or omit certain props to create a black- or whitelist, and then spread those. As far as...
Read more >Why Whitelist Props on Shared React Components - Jake Trent
When we whitelist the props that our components will accept, we know exactly how teams are using our components. Or at least we...
Read more >Tagify - Tags input Component - GitHub Pages
The last tag, "CSS", has the same value as the first tag, and will be removed, because the duplicates setting is set to...
Read more >A bit of history early versions of React kept a whitelist of all the built ...
ContentsEach of these named items will become a component, withTweetbeing the ... Contents6PropsWhere HTML elements have “attributes,” React components have ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This seems to be working: