-
Notifications
You must be signed in to change notification settings - Fork 50.5k
Warn when a DOM element has unsupported property #6465
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ var warning = require('warning'); | |
| if (__DEV__) { | ||
| var reactProps = { | ||
| children: true, | ||
| defaultValue: true, | ||
| dangerouslySetInnerHTML: true, | ||
| key: true, | ||
| ref: true, | ||
|
|
@@ -46,11 +47,10 @@ if (__DEV__) { | |
| null | ||
| ); | ||
|
|
||
| // For now, only warn when we have a suggested correction. This prevents | ||
| // logging too much when using transferPropsTo. | ||
| // Suggest a property name correction if possible | ||
| warning( | ||
| standardName == null, | ||
| 'Unknown DOM property %s. Did you mean %s?', | ||
| 'Unable to assign unsupported DOM property %s. Did you mean %s?', | ||
| name, | ||
| standardName | ||
| ); | ||
|
|
@@ -63,12 +63,20 @@ if (__DEV__) { | |
| null | ||
| ); | ||
|
|
||
| // Suggest an event name correction if possible | ||
| warning( | ||
| registrationName == null, | ||
| 'Unknown event handler property %s. Did you mean `%s`?', | ||
| 'Unable to register unsupported event handler property %s. Did you mean %s?', | ||
| name, | ||
| registrationName | ||
| ); | ||
|
|
||
| // Otherwise at least make it clear that the attributes will be filtered out | ||
| warning( | ||
| standardName != null || registrationName != null, | ||
| 'Unable to assign unsupported DOM property %s.', | ||
| name | ||
| ); | ||
| }; | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated the warning copy here to make it clearer what's going on. Happy to change this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is that this error message doesn't specify the line number, as per the last sentence of my comment in #6459 (comment) |
||
|
|
||
|
|
||
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.
Looks like this is no longer a problem with #2532
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.
It's still a problem;
:%s/transferPropsTo/the spread operator/g.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.
Ack. Okay.