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

Function mountIndeterminateComponent

dash/deps/react-dom@18.3.1.js:20078–20204  ·  view source on GitHub ↗
(_current, workInProgress, Component, renderLanes)

Source from the content-addressed store, hash-verified

20076 }
20077
20078 function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) {
20079 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);
20080 var props = workInProgress.pendingProps;
20081 var context;
20082
20083 {
20084 var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
20085 context = getMaskedContext(workInProgress, unmaskedContext);
20086 }
20087
20088 prepareToReadContext(workInProgress, renderLanes);
20089 var value;
20090 var hasId;
20091
20092 {
20093 markComponentRenderStarted(workInProgress);
20094 }
20095
20096 {
20097 if (Component.prototype && typeof Component.prototype.render === 'function') {
20098 var componentName = getComponentNameFromType(Component) || 'Unknown';
20099
20100 if (!didWarnAboutBadClass[componentName]) {
20101 error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);
20102
20103 didWarnAboutBadClass[componentName] = true;
20104 }
20105 }
20106
20107 if (workInProgress.mode & StrictLegacyMode) {
20108 ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
20109 }
20110
20111 setIsRendering(true);
20112 ReactCurrentOwner$1.current = workInProgress;
20113 value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);
20114 hasId = checkDidRenderIdHook();
20115 setIsRendering(false);
20116 }
20117
20118 {
20119 markComponentRenderStopped();
20120 } // React DevTools reads this flag.
20121
20122
20123 workInProgress.flags |= PerformedWork;
20124
20125 {
20126 // Support for module components is deprecated and is removed behind a flag.
20127 // Whether or not it would crash later, we want to show a good message in DEV first.
20128 if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
20129 var _componentName = getComponentNameFromType(Component) || 'Unknown';
20130
20131 if (!didWarnAboutModulePatternComponent[_componentName]) {
20132 error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);
20133
20134 didWarnAboutModulePatternComponent[_componentName] = true;
20135 }

Callers 1

beginWorkFunction · 0.70

Calls 15

getUnmaskedContextFunction · 0.70
getMaskedContextFunction · 0.70
prepareToReadContextFunction · 0.70
getComponentNameFromTypeFunction · 0.70
errorFunction · 0.70
setIsRenderingFunction · 0.70
renderWithHooksFunction · 0.70
checkDidRenderIdHookFunction · 0.70
isContextProviderFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…