From 4dae72fea58a21dffe49438008083769e61a33df Mon Sep 17 00:00:00 2001 From: omerts Date: Mon, 11 Apr 2016 12:23:49 +0300 Subject: [PATCH 1/3] add component instance onSetState event --- src/isomorphic/ReactDebugTool.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/isomorphic/ReactDebugTool.js b/src/isomorphic/ReactDebugTool.js index 4d2c2a3536a..6aab1692ae9 100644 --- a/src/isomorphic/ReactDebugTool.js +++ b/src/isomorphic/ReactDebugTool.js @@ -55,8 +55,8 @@ var ReactDebugTool = { onEndProcessingChildContext() { emitEvent('onEndProcessingChildContext'); }, - onSetState() { - emitEvent('onSetState'); + onSetState(componentInstance = null) { + emitEvent('onSetState', componentInstance); }, onMountRootComponent(internalInstance) { emitEvent('onMountRootComponent', internalInstance); From c26eef7884a93079d8ef917ddf1d98121f2c56f9 Mon Sep 17 00:00:00 2001 From: omerts Date: Mon, 11 Apr 2016 12:25:39 +0300 Subject: [PATCH 2/3] add component instance onSetState event --- src/isomorphic/modern/class/ReactComponent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/isomorphic/modern/class/ReactComponent.js b/src/isomorphic/modern/class/ReactComponent.js index a775abd67dd..10c85d2fc12 100644 --- a/src/isomorphic/modern/class/ReactComponent.js +++ b/src/isomorphic/modern/class/ReactComponent.js @@ -67,7 +67,7 @@ ReactComponent.prototype.setState = function(partialState, callback) { 'function which returns an object of state variables.' ); if (__DEV__) { - ReactInstrumentation.debugTool.onSetState(); + ReactInstrumentation.debugTool.onSetState(this); warning( partialState != null, 'setState(...): You passed an undefined or null state object; ' + From 4a528f768ab8fbd101c449769838dbed2859c5e4 Mon Sep 17 00:00:00 2001 From: omerts Date: Mon, 11 Apr 2016 12:34:14 +0300 Subject: [PATCH 3/3] removed default param value --- src/isomorphic/ReactDebugTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/isomorphic/ReactDebugTool.js b/src/isomorphic/ReactDebugTool.js index 6aab1692ae9..d5bc1c60bff 100644 --- a/src/isomorphic/ReactDebugTool.js +++ b/src/isomorphic/ReactDebugTool.js @@ -55,7 +55,7 @@ var ReactDebugTool = { onEndProcessingChildContext() { emitEvent('onEndProcessingChildContext'); }, - onSetState(componentInstance = null) { + onSetState(componentInstance) { emitEvent('onSetState', componentInstance); }, onMountRootComponent(internalInstance) {