-
Notifications
You must be signed in to change notification settings - Fork 411
Add shouldForwardProp method #555
Copy link
Copy link
Closed
Labels
feature: proposal 💬New feature proposal that needs to be discussedNew feature proposal that needs to be discussedneeds: investigation 🔎Issue has to be investigated for reason or solutionIssue has to be investigated for reason or solutionneeds: more info ℹNot enough information was provided to work on issueNot enough information was provided to work on issue
Metadata
Metadata
Assignees
Labels
feature: proposal 💬New feature proposal that needs to be discussedNew feature proposal that needs to be discussedneeds: investigation 🔎Issue has to be investigated for reason or solutionIssue has to be investigated for reason or solutionneeds: more info ℹNot enough information was provided to work on issueNot enough information was provided to work on issue
Describe the feature
A
shouldForwardPropconfig method should be added so that custom props don't leak into the DOM.This feature was recently added to styled-components/styled-components#3006.
Motivation
I often use custom
booleanprops to toggle styles but sincebooleanattributes are not valid in the DOM React complains about them.shouldForwardPropwould allow you to explicitly define which props should be passed to the DOM and which props are for internal use.Related Issues
#256