From a42dcf4f7b10eab60bc97d89719eca05731dda35 Mon Sep 17 00:00:00 2001 From: Bartosz Kaszubowski Date: Thu, 5 Mar 2015 21:20:48 +0100 Subject: [PATCH] initialize dev variables in dev mode only --- src/core/shouldUpdateReactComponent.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/shouldUpdateReactComponent.js b/src/core/shouldUpdateReactComponent.js index 49a35a2730..7892c86375 100644 --- a/src/core/shouldUpdateReactComponent.js +++ b/src/core/shouldUpdateReactComponent.js @@ -36,11 +36,11 @@ function shouldUpdateReactComponent(prevElement, nextElement) { prevElement.type === nextElement.type && prevElement.key === nextElement.key) { var ownersMatch = prevElement._owner === nextElement._owner; - var prevName = null; - var nextName = null; - var nextDisplayName = null; if (__DEV__) { if (!ownersMatch) { + var prevName = null; + var nextName = null; + var nextDisplayName = null; if (prevElement._owner != null && prevElement._owner.getPublicInstance() != null && prevElement._owner.getPublicInstance().constructor != null) {