Skip to content
Merged
Changes from all commits
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
33 changes: 20 additions & 13 deletions src/core/shouldUpdateReactComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,26 @@ function shouldUpdateReactComponent(prevElement, nextElement) {
nextElement.type.displayName != null) {
nextDisplayName = nextElement.type.displayName;
}
warning(
false,
'<%s /> is being rendered by both %s and %s using the same key ' +
'(%s) in the same place. Currently, this means that they ' +
'don\'t preserve state. This behavior should be very rare ' +
'so we\'re considering deprecating it. Please contact the ' +
'React team and explain your use case so that we can take that ' +
'into consideration.',
nextDisplayName || 'Unknown Component',
prevName || '[Unknown]',
nextName || '[Unknown]',
prevElement.key
);
if (nextElement.type != null && typeof nextElement.type === 'string') {
nextDisplayName = nextElement.type;
}
if (typeof nextElement.type !== 'string' ||
nextElement.type === 'input' ||
nextElement.type === 'textarea') {
warning(
false,
'<%s /> is being rendered by both %s and %s using the same key ' +
'(%s) in the same place. Currently, this means that they ' +
'don\'t preserve state. This behavior should be very rare ' +
'so we\'re considering deprecating it. Please contact the ' +
'React team and explain your use case so that we can take that ' +
'into consideration.',
nextDisplayName || 'Unknown Component',
prevName || '[Unknown]',
nextName || '[Unknown]',
prevElement.key
);
}
}
}
return ownersMatch;
Expand Down