Skip to content

Commit

Permalink
Move instrumentation to renderers/shared. Closes facebook#6797
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdustan committed May 19, 2016
1 parent 8ea1cf4 commit 69ca6d3
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/isomorphic/modern/class/ReactComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
'use strict';

var ReactNoopUpdateQueue = require('ReactNoopUpdateQueue');
var ReactInstrumentation = require('ReactInstrumentation');

var canDefineProperty = require('canDefineProperty');
var emptyObject = require('emptyObject');
Expand Down Expand Up @@ -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');
Expand Down
10 changes: 10 additions & 0 deletions src/renderers/shared/stack/reconciler/ReactUpdateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

var ReactCurrentOwner = require('ReactCurrentOwner');
var ReactInstanceMap = require('ReactInstanceMap');
var ReactInstrumentation = require('ReactInstrumentation');
var ReactUpdates = require('ReactUpdates');

var invariant = require('invariant');
Expand Down Expand Up @@ -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'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 69ca6d3

Please sign in to comment.