public/render-page.js
// Extra closure so queue and replace can be captured properly
Extra closure so queue and replace can be captured properly
Extra closure so queue and replace can be captured properly
function processChild(element, Component) {
	    var publicContext = processContext(Component, context);
	    var queue = [];
	    var replace = false;
	    var updater = {
	      isMounted: function (publicInstance) {
	        return false;
	      },
	      enqueueForceUpdate: function (publicInstance) {
	        if (queue === null) {
	          warnNoop(publicInstance, 'forceUpdate');
	          return null;
	        }
	      },
	      enqueueReplaceState: function (publicInstance, completeState) {
	        replace = true;
	        queue = [completeState];
	      },
	      enqueueSetState: function (publicInstance, currentPartialState) {
	        if (queue === null) {
	          warnNoop(publicInstance, 'setState');
	          return null;
	        }
	        queue.push(currentPartialState);
	      }
	    };
	    var inst = void 0;
	    if (shouldConstruct(Component)) {
	      inst = new Component(element.props, publicContext, updater);
	      if (typeof Component.getDerivedStateFromProps === 'function') {
	        {
	          if (inst.state === null || inst.state === undefined) {
	            var componentName = getComponentName(Component) || 'Unknown';
	            if (!didWarnAboutUninitializedState[componentName]) {
	              warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');
	              didWarnAboutUninitializedState[componentName] = true;
	            }
	          }
	        }
	        var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
	        {
	          if (partialState === undefined) {
	            var _componentName = getComponentName(Component) || 'Unknown';
	            if (!didWarnAboutUndefinedDerivedState[_componentName]) {
	              warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
	              didWarnAboutUndefinedDerivedState[_componentName] = true;
	            }
	          }
	        }
	        if (partialState != null) {
	          inst.state = _assign({}, inst.state, partialState);
	        }
	      }
	    } else {
	      {
	        if (Component.prototype && typeof Component.prototype.render === 'function') {
	          var _componentName2 = getComponentName(Component) || 'Unknown';
	          if (!didWarnAboutBadClass[_componentName2]) {
	            warning(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);
	            didWarnAboutBadClass[_componentName2] = true;
	          }
	        }
	      }
	      inst = Component(element.props, publicContext, updater);
	      if (inst == null || inst.render == null) {
	        child = inst;
	        validateRenderResult(child, Component);
	        return;
	      }
	    }
	    inst.props = element.props;
	    inst.context = publicContext;
	    inst.updater = updater;
	    var initialState = inst.state;
	    if (initialState === undefined) {
	      inst.state = initialState = null;
	    }
	    if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
	      if (typeof inst.componentWillMount === 'function') {
	        {
	          if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {
	            var _componentName3 = getComponentName(Component) || 'Unknown';
	            if (!didWarnAboutDeprecatedWillMount[_componentName3]) {
	              lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\n\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);
	              didWarnAboutDeprecatedWillMount[_componentName3] = true;
	            }
	          }
	        }
	        if (typeof Component.getDerivedStateFromProps !== 'function') {
	          inst.componentWillMount();
	        }
	      }
	      if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {
	        inst.UNSAFE_componentWillMount();
	      }
	      if (queue.length) {
	        var oldQueue = queue;
	        var oldReplace = replace;
	        queue = null;
	        replace = false;
	        if (oldReplace && oldQueue.length === 1) {
	          inst.state = oldQueue[0];
	        } else {
	          var nextState = oldReplace ? oldQueue[0] : inst.state;
	          var dontMutate = true;
	          for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
	            var partial = oldQueue[i];
	            var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
	            if (_partialState != null) {
	              if (dontMutate) {
	                dontMutate = false;
	                nextState = _assign({}, nextState, _partialState);
	              } else {
	                _assign(nextState, _partialState);
	              }
	            }
	          }
	          inst.state = nextState;
	        }
	      } else {
	        queue = null;
	      }
	    }
	    child = inst.render();
	    {
	      if (child === undefined && inst.render._isMockFunction) {
	        child = null;
	      }
	    }
	    validateRenderResult(child, Component);
	    var childContext = void 0;
	    if (typeof inst.getChildContext === 'function') {
	      var childContextTypes = Component.childContextTypes;
	      if (typeof childContextTypes === 'object') {
	        childContext = inst.getChildContext();
	        for (var contextKey in childContext) {
	          !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
	        }
	      } else {
	        warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
	      }
	    }
	    if (childContext) {
	      context = _assign({}, context, childContext);
	    }
	  }
function processChild ( element , Component ) { var publicContext = processContext ( Component , context ) ; var queue = [ ] ; var replace = false ; var updater = { isMounted : function ( publicInstance ) { return false ; } , enqueueForceUpdate : function ( publicInstance ) { if ( queue === null ) { warnNoop ( publicInstance , 'forceUpdate' ) ; return null ; } } , enqueueReplaceState : function ( publicInstance , completeState ) { replace = true ; queue = [ completeState ] ; } , enqueueSetState : function ( publicInstance , currentPartialState ) { if ( queue === null ) { warnNoop ( publicInstance , 'setState' ) ; return null ; } queue . push ( currentPartialState ) ; } } ; var inst = void 0 ; if ( shouldConstruct ( Component ) ) { inst = new Component ( element . props , publicContext , updater ) ; if ( typeof Component . getDerivedStateFromProps === 'function' ) { { if ( inst . state === null || inst . state === undefined ) { var componentName = getComponentName ( Component ) || 'Unknown' ; if ( ! didWarnAboutUninitializedState [ componentName ] ) { warning ( false , '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.' , componentName , inst . state === null ? 'null' : 'undefined' ) ; didWarnAboutUninitializedState [ componentName ] = true ; } } } var partialState = Component . getDerivedStateFromProps . call ( null , element . props , inst . state ) ; { if ( partialState === undefined ) { var _componentName = getComponentName ( Component ) || 'Unknown' ; if ( ! didWarnAboutUndefinedDerivedState [ _componentName ] ) { warning ( false , '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.' , _componentName ) ; didWarnAboutUndefinedDerivedState [ _componentName ] = true ; } } } if ( partialState != null ) { inst . state = _assign ( { } , inst . state , partialState ) ; } } } else { { if ( Component . prototype && typeof Component . prototype . render === 'function' ) { var _componentName2 = getComponentName ( Component ) || 'Unknown' ; if ( ! didWarnAboutBadClass [ _componentName2 ] ) { warning ( false , "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.' , _componentName2 , _componentName2 ) ; didWarnAboutBadClass [ _componentName2 ] = true ; } } } inst = Component ( element . props , publicContext , updater ) ; if ( inst == null || inst . render == null ) { child = inst ; validateRenderResult ( child , Component ) ; return ; } } inst . props = element . props ; inst . context = publicContext ; inst . updater = updater ; var initialState = inst . state ; if ( initialState === undefined ) { inst . state = initialState = null ; } if ( typeof inst . UNSAFE_componentWillMount === 'function' || typeof inst . componentWillMount === 'function' ) { if ( typeof inst . componentWillMount === 'function' ) { { if ( warnAboutDeprecatedLifecycles && inst . componentWillMount . __suppressDeprecationWarning !== true ) { var _componentName3 = getComponentName ( Component ) || 'Unknown' ; if ( ! didWarnAboutDeprecatedWillMount [ _componentName3 ] ) { lowPriorityWarning$1 ( false , '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\n\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.' , _componentName3 ) ; didWarnAboutDeprecatedWillMount [ _componentName3 ] = true ; } } } if ( typeof Component . getDerivedStateFromProps !== 'function' ) { inst . componentWillMount ( ) ; } } if ( typeof inst . UNSAFE_componentWillMount === 'function' && typeof Component . getDerivedStateFromProps !== 'function' ) { inst . UNSAFE_componentWillMount ( ) ; } if ( queue . length ) { var oldQueue = queue ; var oldReplace = replace ; queue = null ; replace = false ; if ( oldReplace && oldQueue . length === 1 ) { inst . state = oldQueue [ 0 ] ; } else { var nextState = oldReplace ? oldQueue [ 0 ] : inst . state ; var dontMutate = true ; for ( var i = oldReplace ? 1 : 0 ; i < oldQueue . length ; i ++ ) { var partial = oldQueue [ i ] ; var _partialState = typeof partial === 'function' ? partial . call ( inst , nextState , element . props , publicContext ) : partial ; if ( _partialState != null ) { if ( dontMutate ) { dontMutate = false ; nextState = _assign ( { } , nextState , _partialState ) ; } else { _assign ( nextState , _partialState ) ; } } } inst . state = nextState ; } } else { queue = null ; } } child = inst . render ( ) ; { if ( child === undefined && inst . render . _isMockFunction ) { child = null ; } } validateRenderResult ( child , Component ) ; var childContext = void 0 ; if ( typeof inst . getChildContext === 'function' ) { var childContextTypes = Component . childContextTypes ; if ( typeof childContextTypes === 'object' ) { childContext = inst . getChildContext ( ) ; for ( var contextKey in childContext ) { ! ( contextKey in childContextTypes ) ? invariant ( false , '%s.getChildContext(): key "%s" is not defined in childContextTypes.' , getComponentName ( Component ) || 'Unknown' , contextKey ) : void 0 ; } } else { warning ( false , '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().' , getComponentName ( Component ) || 'Unknown' ) ; } } if ( childContext ) { context = _assign ( { } , context , childContext ) ; } }
Extra closure so queue and replace can be captured properly
Extra closure so queue and replace can be captured properly
// In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for any component with the new gDSFP. // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for any component with the new gDSFP. // This is probably bad practice. Consider warning here and // deprecating this convenience.