@@ -158,7 +158,6 @@ var ReactCompositeComponentMixin = assign({},
158158 * @internal
159159 */
160160 mountComponent : function ( rootID , transaction , mountDepth , context ) {
161- invariant ( context !== undefined , "Context is required parameter" ) ;
162161 ReactComponent . Mixin . mountComponent . call (
163162 this ,
164163 rootID ,
@@ -520,7 +519,6 @@ var ReactCompositeComponentMixin = assign({},
520519 } ,
521520
522521 receiveComponent : function ( nextElement , transaction , context ) {
523- invariant ( context !== undefined , "Context is required parameter" ) ;
524522 if ( nextElement === this . _currentElement &&
525523 nextElement . _owner != null ) {
526524 // Since elements are immutable after the owner is rendered,
@@ -589,8 +587,6 @@ var ReactCompositeComponentMixin = assign({},
589587 * TODO: Remove this check when owner-context is removed
590588 */
591589 _warnIfContextsDiffer : function ( ownerBasedContext , parentBasedContext ) {
592- invariant ( ownerBasedContext !== undefined , "Owner based context is required parameter" ) ;
593- invariant ( parentBasedContext !== undefined , "Parent based ontext is required parameter" ) ;
594590 var ownerKeys = Object . keys ( ownerBasedContext ) . sort ( ) ;
595591 var parentKeys = Object . keys ( parentBasedContext ) . sort ( ) ;
596592 if ( ownerKeys . length != parentKeys . length || ownerKeys . toString ( ) != parentKeys . toString ( ) ) {
@@ -720,8 +716,6 @@ var ReactCompositeComponentMixin = assign({},
720716 transaction ,
721717 unmaskedContext
722718 ) {
723- invariant ( unmaskedContext !== undefined , "Context required for mounting" ) ;
724- invariant ( unmaskedContext !== null , "Context must be non-null" ) ;
725719 var inst = this . _instance ;
726720
727721 var prevProps = inst . props ;
@@ -755,7 +749,6 @@ var ReactCompositeComponentMixin = assign({},
755749 * @internal
756750 */
757751 _updateRenderedComponent : function ( transaction , context ) {
758- invariant ( context !== undefined , "Context is required parameter" ) ;
759752 var prevComponentInstance = this . _renderedComponent ;
760753 var prevRenderedElement = prevComponentInstance . _currentElement ;
761754 var nextRenderedElement = this . _renderValidatedComponent ( ) ;
@@ -968,25 +961,11 @@ var ShallowMixin = assign({},
968961 var prevComponentInstance = this . _renderedComponent ;
969962 var prevRenderedElement = prevComponentInstance . _currentElement ;
970963 // Use the without-owner-or-context variant of _rVC below:
971- var nextRenderedElement = this . _renderValidatedComponentWithoutOwnerOrContext ( ) ;
972- if ( shouldUpdateReactComponent ( prevRenderedElement , nextRenderedElement ) ) {
973- prevComponentInstance . receiveComponent (
974- nextRenderedElement ,
975- transaction
976- ) ;
977- } else {
978- // These two IDs are actually the same! But nothing should rely on that.
979- var thisID = this . _rootNodeID ;
980- var prevComponentID = prevComponentInstance . _rootNodeID ;
981- // Don't unmount previous instance since it was never mounted, due to
982- // shallow render.
983- //prevComponentInstance.unmountComponent();
984- this . _renderedComponent = nextRenderedElement ;
985- // ^ no instantiateReactComponent
986- //
987- // no recursive mountComponent
988- return nextRenderedElement ;
989- }
964+ var nextRenderedElement =
965+ this . _renderValidatedComponentWithoutOwnerOrContext ( ) ;
966+ // This is a noop in shallow render
967+ shouldUpdateReactComponent ( prevRenderedElement , nextRenderedElement ) ;
968+ this . _renderedComponent = nextRenderedElement ;
990969 }
991970
992971} ) ;
0 commit comments