maskedContext should not be instantiated as null
chico committed
Oct 31, 2015 at 03:24 UTC
8a9039891b28041803c05c571bfd078b06306e11
1 file changed
+4
-2
src/renderers/shared/reconciler/ReactCompositeComponent.js
+4
-2
@@ -122,6 +122,9 @@ var ReactCompositeComponentMixin = {
122
*
123
* @param {string} rootID DOM ID of the root node.
124
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
125
+ * @param {?object} nativeParent
126
+ * @param {?object} nativeContainerInfo
127
+ * @param {?object} context
128
* @return {?string} Rendered markup to be inserted into the DOM.
129
* @final
130
* @internal
@@ -370,13 +373,12 @@ var ReactCompositeComponentMixin = {
373
* @private
374
*/
375
_maskContext: function(context) {
373
- var maskedContext = null;
376
var Component = this._currentElement.type;
377
var contextTypes = Component.contextTypes;
378
if (!contextTypes) {
379
return emptyObject;
380
}
379
- maskedContext = {};
381
+ var maskedContext = {};
382
for (var contextName in contextTypes) {
383
maskedContext[contextName] = context[contextName];
384
}