Skip to content
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

Find callsites that would call toString() if we pass attributes through #10416

Merged
merged 2 commits into from
Aug 11, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,23 @@ var warnUnknownProperties = function(type, props, debugID) {
var isValid = validateProperty(type, key, debugID);
if (!isValid) {
unknownProps.push(key);
var value = props[key];
if (
typeof value === 'object' &&
value !== null &&
!Array.isArray(value) &&
value.toString !== Object.prototype.toString
) {
warning(
false,
'The %s prop on <%s> is not a known property, and was given an object ' +
'with a custom toString() method. Remove it, or it will appear in the ' +
'DOM after a future React update.%s',
key,
type,
getStackAddendum(debugID),
);
}
}
}

Expand Down