MCPcopy Index your code
hub / github.com/caseywebdev/react-list / updateClassComponent

Function updateClassComponent

docs/index.js:9194–9454  ·  view source on GitHub ↗
(
  current,
  workInProgress,
  Component,
  nextProps,
  renderLanes
)

Source from the content-addressed store, hash-verified

9192 return workInProgress.child;
9193}
9194function updateClassComponent(
9195 current,
9196 workInProgress,
9197 Component,
9198 nextProps,
9199 renderLanes
9200) {
9201 prepareToReadContext(workInProgress);
9202 if (null === workInProgress.stateNode) {
9203 var context = emptyContextObject,
9204 contextType = Component.contextType;
9205 "object" === typeof contextType &&
9206 null !== contextType &&
9207 (context = readContext(contextType));
9208 context = new Component(nextProps, context);
9209 workInProgress.memoizedState =
9210 null !== context.state && void 0 !== context.state ? context.state : null;
9211 context.updater = classComponentUpdater;
9212 workInProgress.stateNode = context;
9213 context._reactInternals = workInProgress;
9214 context = workInProgress.stateNode;
9215 context.props = nextProps;
9216 context.state = workInProgress.memoizedState;
9217 context.refs = {};
9218 initializeUpdateQueue(workInProgress);
9219 contextType = Component.contextType;
9220 context.context =
9221 "object" === typeof contextType && null !== contextType
9222 ? readContext(contextType)
9223 : emptyContextObject;
9224 context.state = workInProgress.memoizedState;
9225 contextType = Component.getDerivedStateFromProps;
9226 "function" === typeof contextType &&
9227 (applyDerivedStateFromProps(
9228 workInProgress,
9229 Component,
9230 contextType,
9231 nextProps
9232 ),
9233 (context.state = workInProgress.memoizedState));
9234 "function" === typeof Component.getDerivedStateFromProps ||
9235 "function" === typeof context.getSnapshotBeforeUpdate ||
9236 ("function" !== typeof context.UNSAFE_componentWillMount &&
9237 "function" !== typeof context.componentWillMount) ||
9238 ((contextType = context.state),
9239 "function" === typeof context.componentWillMount &&
9240 context.componentWillMount(),
9241 "function" === typeof context.UNSAFE_componentWillMount &&
9242 context.UNSAFE_componentWillMount(),
9243 contextType !== context.state &&
9244 classComponentUpdater.enqueueReplaceState(context, context.state, null),
9245 processUpdateQueue(workInProgress, nextProps, context, renderLanes),
9246 suspendIfUpdateReadFromEntangledAsyncAction(),
9247 (context.state = workInProgress.memoizedState));
9248 "function" === typeof context.componentDidMount &&
9249 (workInProgress.flags |= 4194308);
9250 nextProps = !0;
9251 } else if (null === current) {

Callers 1

beginWorkFunction · 0.85

Calls 15

prepareToReadContextFunction · 0.85
readContextFunction · 0.85
initializeUpdateQueueFunction · 0.85
processUpdateQueueFunction · 0.85
cloneUpdateQueueFunction · 0.85
checkIfContextChangedFunction · 0.85
markRefFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…