-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
group warnings for unknown DOM properties #7153
Conversation
tagName, | ||
ReactComponentTreeDevtool.getStackAddendumByID(debugID) | ||
); | ||
unknownProp = name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The calling function already knows the name of the unknown prop—it passes it as an argument. Let’s just return true
if there is no need for additional warning, and false
if we still need to warn. We can rename handleProperty
to validateProperty
.
Thanks! I left a few comments about refactoring but this mostly looks good! |
e1c2bfe
to
adf73d3
Compare
@gaearon Thanks for the feedback. I have incorporated your suggestions. |
@@ -75,6 +75,8 @@ if (__DEV__) { | |||
standardName, | |||
ReactComponentTreeDevtool.getStackAddendumByID(debugID) | |||
); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: let’s remove this newline.
Accepting with nits. Please fix those and I’ll merge. Thanks! |
adf73d3
to
5ce2cbc
Compare
Nits fixed. |
Could you try this test:
A screenshot verifying it would be most welcome 😄 |
(cherry picked from commit 39265cb)
#7152. May need to refactor, but I think this is the idea.