(workInProgress, instance, newProps, nextContext)
| 18302 | } |
| 18303 | |
| 18304 | function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { |
| 18305 | var oldState = instance.state; |
| 18306 | |
| 18307 | if (typeof instance.componentWillReceiveProps === 'function') { |
| 18308 | instance.componentWillReceiveProps(newProps, nextContext); |
| 18309 | } |
| 18310 | |
| 18311 | if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { |
| 18312 | instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); |
| 18313 | } |
| 18314 | |
| 18315 | if (instance.state !== oldState) { |
| 18316 | { |
| 18317 | var componentName = getComponentNameFromFiber(workInProgress) || 'Component'; |
| 18318 | |
| 18319 | if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { |
| 18320 | didWarnAboutStateAssignmentForComponent.add(componentName); |
| 18321 | |
| 18322 | error('%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); |
| 18323 | } |
| 18324 | } |
| 18325 | |
| 18326 | classComponentUpdater.enqueueReplaceState(instance, instance.state, null); |
| 18327 | } |
| 18328 | } // Invokes the mount life-cycles on a previously never rendered instance. |
| 18329 | |
| 18330 | |
| 18331 | function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { |
no test coverage detected
searching dependent graphs…