invert few if-else with negation for readability

This commit is contained in:
Bartosz Kaszubowski
2015-07-18 00:19:28 +02:00
parent cc85f42f0f
commit da11691e26
4 changed files with 17 additions and 17 deletions
+3 -3
View File
@@ -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);
}
};