(workInProgress, instance, newProps, newContext)
| 8601 | } |
| 8602 | |
| 8603 | function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) { |
| 8604 | var oldState = instance.state; |
| 8605 | startPhaseTimer(workInProgress, 'componentWillReceiveProps'); |
| 8606 | if (typeof instance.componentWillReceiveProps === 'function') { |
| 8607 | instance.componentWillReceiveProps(newProps, newContext); |
| 8608 | } |
| 8609 | if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { |
| 8610 | instance.UNSAFE_componentWillReceiveProps(newProps, newContext); |
| 8611 | } |
| 8612 | stopPhaseTimer(); |
| 8613 | |
| 8614 | if (instance.state !== oldState) { |
| 8615 | { |
| 8616 | var componentName = getComponentName(workInProgress) || 'Component'; |
| 8617 | if (!didWarnAboutStateAssignmentForComponent[componentName]) { |
| 8618 | warning(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); |
| 8619 | didWarnAboutStateAssignmentForComponent[componentName] = true; |
| 8620 | } |
| 8621 | } |
| 8622 | updater.enqueueReplaceState(instance, instance.state, null); |
| 8623 | } |
| 8624 | } |
| 8625 | |
| 8626 | function callGetDerivedStateFromProps(workInProgress, instance, nextProps, prevState) { |
| 8627 | var type = workInProgress.type; |
no test coverage detected