mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Move instrumentation to renderers/shared. Closes #6797
This commit is contained in:
1 parent
8ea1cf4ee0
commit
d51981eeea
13 files changed
+10
-9
No files matched your search
@@ -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');
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user