(workInProgress, instance, newProps, newContext)
| 8463 | } |
| 8464 | |
| 8465 | function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) { |
| 8466 | var oldState = instance.state; |
| 8467 | startPhaseTimer(workInProgress, 'componentWillReceiveProps'); |
| 8468 | if (typeof instance.componentWillReceiveProps === 'function') { |
| 8469 | instance.componentWillReceiveProps(newProps, newContext); |
| 8470 | } |
| 8471 | if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { |
| 8472 | instance.UNSAFE_componentWillReceiveProps(newProps, newContext); |
| 8473 | } |
| 8474 | stopPhaseTimer(); |
| 8475 | |
| 8476 | if (instance.state !== oldState) { |
| 8477 | { |
| 8478 | var componentName = getComponentName(workInProgress) || 'Component'; |
| 8479 | if (!didWarnAboutStateAssignmentForComponent[componentName]) { |
| 8480 | warning(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); |
| 8481 | didWarnAboutStateAssignmentForComponent[componentName] = true; |
| 8482 | } |
| 8483 | } |
| 8484 | updater.enqueueReplaceState(instance, instance.state, null); |
| 8485 | } |
| 8486 | } |
| 8487 | |
| 8488 | function callGetDerivedStateFromProps(workInProgress, instance, nextProps, prevState) { |
| 8489 | var type = workInProgress.type; |
no test coverage detected