diff --git a/src/isomorphic/modern/class/ReactComponent.js b/src/isomorphic/modern/class/ReactComponent.js index a775abd67dda6..b93da63e94cf9 100644 --- a/src/isomorphic/modern/class/ReactComponent.js +++ b/src/isomorphic/modern/class/ReactComponent.js @@ -12,7 +12,6 @@ 'use strict'; var ReactNoopUpdateQueue = require('ReactNoopUpdateQueue'); -var ReactInstrumentation = require('ReactInstrumentation'); var canDefineProperty = require('canDefineProperty'); var emptyObject = require('emptyObject'); @@ -66,14 +65,6 @@ ReactComponent.prototype.setState = function(partialState, callback) { 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.' ); - if (__DEV__) { - ReactInstrumentation.debugTool.onSetState(); - warning( - partialState != null, - 'setState(...): You passed an undefined or null state object; ' + - 'instead, use forceUpdate().' - ); - } this.updater.enqueueSetState(this, partialState); if (callback) { this.updater.enqueueCallback(this, callback, 'setState'); diff --git a/src/isomorphic/ReactDebugTool.js b/src/renderers/shared/ReactDebugTool.js similarity index 100% rename from src/isomorphic/ReactDebugTool.js rename to src/renderers/shared/ReactDebugTool.js diff --git a/src/isomorphic/ReactInstrumentation.js b/src/renderers/shared/ReactInstrumentation.js similarity index 100% rename from src/isomorphic/ReactInstrumentation.js rename to src/renderers/shared/ReactInstrumentation.js diff --git a/src/isomorphic/ReactPerf.js b/src/renderers/shared/ReactPerf.js similarity index 100% rename from src/isomorphic/ReactPerf.js rename to src/renderers/shared/ReactPerf.js diff --git a/src/isomorphic/__tests__/ReactDebugTool-test.js b/src/renderers/shared/__tests__/ReactDebugTool-test.js similarity index 100% rename from src/isomorphic/__tests__/ReactDebugTool-test.js rename to src/renderers/shared/__tests__/ReactDebugTool-test.js diff --git a/src/isomorphic/__tests__/ReactPerf-test.js b/src/renderers/shared/__tests__/ReactPerf-test.js similarity index 100% rename from src/isomorphic/__tests__/ReactPerf-test.js rename to src/renderers/shared/__tests__/ReactPerf-test.js diff --git a/src/isomorphic/devtools/ReactComponentTreeDevtool.js b/src/renderers/shared/devtools/ReactComponentTreeDevtool.js similarity index 100% rename from src/isomorphic/devtools/ReactComponentTreeDevtool.js rename to src/renderers/shared/devtools/ReactComponentTreeDevtool.js diff --git a/src/isomorphic/devtools/ReactHostOperationHistoryDevtool.js b/src/renderers/shared/devtools/ReactHostOperationHistoryDevtool.js similarity index 100% rename from src/isomorphic/devtools/ReactHostOperationHistoryDevtool.js rename to src/renderers/shared/devtools/ReactHostOperationHistoryDevtool.js diff --git a/src/isomorphic/devtools/ReactInvalidSetStateWarningDevTool.js b/src/renderers/shared/devtools/ReactInvalidSetStateWarningDevTool.js similarity index 100% rename from src/isomorphic/devtools/ReactInvalidSetStateWarningDevTool.js rename to src/renderers/shared/devtools/ReactInvalidSetStateWarningDevTool.js diff --git a/src/isomorphic/devtools/__tests__/ReactComponentTreeDevtool-test.js b/src/renderers/shared/devtools/__tests__/ReactComponentTreeDevtool-test.js similarity index 100% rename from src/isomorphic/devtools/__tests__/ReactComponentTreeDevtool-test.js rename to src/renderers/shared/devtools/__tests__/ReactComponentTreeDevtool-test.js diff --git a/src/isomorphic/devtools/__tests__/ReactComponentTreeDevtool-test.native.js b/src/renderers/shared/devtools/__tests__/ReactComponentTreeDevtool-test.native.js similarity index 100% rename from src/isomorphic/devtools/__tests__/ReactComponentTreeDevtool-test.native.js rename to src/renderers/shared/devtools/__tests__/ReactComponentTreeDevtool-test.native.js diff --git a/src/isomorphic/devtools/__tests__/ReactHostOperationHistoryDevtool-test.js b/src/renderers/shared/devtools/__tests__/ReactHostOperationHistoryDevtool-test.js similarity index 100% rename from src/isomorphic/devtools/__tests__/ReactHostOperationHistoryDevtool-test.js rename to src/renderers/shared/devtools/__tests__/ReactHostOperationHistoryDevtool-test.js diff --git a/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js b/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js index 65bdd490525a4..94369f43348da 100644 --- a/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js +++ b/src/renderers/shared/stack/reconciler/ReactUpdateQueue.js @@ -13,6 +13,7 @@ var ReactCurrentOwner = require('ReactCurrentOwner'); var ReactInstanceMap = require('ReactInstanceMap'); +var ReactInstrumentation = require('ReactInstrumentation'); var ReactUpdates = require('ReactUpdates'); var invariant = require('invariant'); @@ -219,6 +220,15 @@ var ReactUpdateQueue = { * @internal */ enqueueSetState: function(publicInstance, partialState) { + if (__DEV__) { + ReactInstrumentation.debugTool.onSetState(); + warning( + partialState != null, + 'setState(...): You passed an undefined or null state object; ' + + 'instead, use forceUpdate().' + ); + } + var internalInstance = getInternalInstanceReadyForUpdate( publicInstance, 'setState'