Fix cases where owner warning is shown
In b0431a5 I added the check in the wrong place which could cause the warning to be shown because of key changes rather than owner changes like the warning suggests.
Ben Alpert committed
Jan 3, 2014 at 13:31 UTC
f5a48f1ff4a06ed5d281b51a9ed422414f007cb2
1 file changed
+5
-5
src/core/shouldUpdateReactComponent.js
+5
-5
@@ -31,11 +31,11 @@
31
function shouldUpdateReactComponent(prevComponent, nextComponent) {
32
// TODO: Remove warning after a release.
33
if (prevComponent && nextComponent &&
34
- prevComponent.constructor === nextComponent.constructor) {
35
- if (prevComponent._owner === nextComponent._owner && (
36
- (prevComponent.props && prevComponent.props.key) ===
37
- (nextComponent.props && nextComponent.props.key)
38
- )) {
34
+ prevComponent.constructor === nextComponent.constructor && (
35
+ (prevComponent.props && prevComponent.props.key) ===
36
+ (nextComponent.props && nextComponent.props.key)
37
+ )) {
38
+ if (prevComponent._owner === nextComponent._owner) {
39
return true;
40
} else {
41
if (__DEV__) {