Skip to content

Commit

Permalink
Find callsites that would call toString() if pass attributes through
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Aug 9, 2017
1 parent c3718c4 commit 0c342a8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 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,22 @@ var warnUnknownProperties = function(type, props, debugID) {
var isValid = validateProperty(type, key, debugID);
if (!isValid) {
unknownProps.push(key);
var value = props[key];
if (
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

0 comments on commit 0c342a8

Please sign in to comment.