Expose ReactReconciler

This can be used by devtools to monkey patch the reconciler and therefore
get notified whenever any internal instance is updated.
This commit is contained in:
Sebastian Markbage
2015-02-02 18:15:31 -08:00
parent 63c3461af7
commit e67ff7ee78
3 changed files with 22 additions and 8 deletions
+14
View File
@@ -100,6 +100,20 @@ var ReactReconciler = {
if (refsChanged) {
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
}
},
/**
* Flush any dirty changes in a component.
*
* @param {ReactComponent} internalInstance
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function(
internalInstance,
transaction
) {
internalInstance.performUpdateIfNecessary(transaction);
}
};
+6 -1
View File
@@ -15,6 +15,7 @@ var CallbackQueue = require('CallbackQueue');
var PooledClass = require('PooledClass');
var ReactCurrentOwner = require('ReactCurrentOwner');
var ReactPerf = require('ReactPerf');
var ReactReconciler = require('ReactReconciler');
var Transaction = require('Transaction');
var assign = require('Object.assign');
@@ -146,7 +147,11 @@ function runBatchedUpdates(transaction) {
// stash the callbacks first
var callbacks = component._pendingCallbacks;
component._pendingCallbacks = null;
component.performUpdateIfNecessary(transaction.reconcileTransaction);
ReactReconciler.performUpdateIfNecessary(
component,
transaction.reconcileTransaction
);
if (callbacks) {
for (var j = 0; j < callbacks.length; j++) {