MCPcopy Create free account
hub / github.com/plotly/dash / callComponentWillReceiveProps

Function callComponentWillReceiveProps

dash/deps/react-dom@18.3.1.js:18304–18328  ·  view source on GitHub ↗
(workInProgress, instance, newProps, nextContext)

Source from the content-addressed store, hash-verified

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) {

Callers 2

resumeMountClassInstanceFunction · 0.70
updateClassInstanceFunction · 0.70

Calls 4

errorFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…