mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
invert few if-else with negation for readability
This commit is contained in:
@@ -410,7 +410,9 @@ ReactShallowRenderer.prototype.unmount = function() {
|
||||
};
|
||||
|
||||
ReactShallowRenderer.prototype._render = function(element, transaction, context) {
|
||||
if (!this._instance) {
|
||||
if (this._instance) {
|
||||
this._instance.receiveComponent(element, transaction, context);
|
||||
} else {
|
||||
var rootID = ReactInstanceHandles.createReactRootID();
|
||||
var instance = new ShallowComponentWrapper(element.type);
|
||||
instance.construct(element);
|
||||
@@ -418,8 +420,6 @@ ReactShallowRenderer.prototype._render = function(element, transaction, context)
|
||||
instance.mountComponent(rootID, transaction, context);
|
||||
|
||||
this._instance = instance;
|
||||
} else {
|
||||
this._instance.receiveComponent(element, transaction, context);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user