(workInProgress, instance, newProps, newContext)
| 7696 | } |
| 7697 | |
| 7698 | function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) { |
| 7699 | var oldState = instance.state; |
| 7700 | startPhaseTimer(workInProgress, 'componentWillReceiveProps'); |
| 7701 | if (typeof instance.componentWillReceiveProps === 'function') { |
| 7702 | instance.componentWillReceiveProps(newProps, newContext); |
| 7703 | } |
| 7704 | if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { |
| 7705 | instance.UNSAFE_componentWillReceiveProps(newProps, newContext); |
| 7706 | } |
| 7707 | stopPhaseTimer(); |
| 7708 | |
| 7709 | if (instance.state !== oldState) { |
| 7710 | { |
| 7711 | var componentName = getComponentName(workInProgress) || 'Component'; |
| 7712 | if (!didWarnAboutStateAssignmentForComponent[componentName]) { |
| 7713 | warning(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); |
| 7714 | didWarnAboutStateAssignmentForComponent[componentName] = true; |
| 7715 | } |
| 7716 | } |
| 7717 | updater.enqueueReplaceState(instance, instance.state, null); |
| 7718 | } |
| 7719 | } |
| 7720 | |
| 7721 | function callGetDerivedStateFromProps(workInProgress, instance, nextProps, prevState) { |
| 7722 | var type = workInProgress.type; |
no test coverage detected