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

Function mountLazyComponent

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

Source from the content-addressed store, hash-verified

19975 }
19976
19977 function mountLazyComponent(_current, workInProgress, elementType, renderLanes) {
19978 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);
19979 var props = workInProgress.pendingProps;
19980 var lazyComponent = elementType;
19981 var payload = lazyComponent._payload;
19982 var init = lazyComponent._init;
19983 var Component = init(payload); // Store the unwrapped component in the type.
19984
19985 workInProgress.type = Component;
19986 var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
19987 var resolvedProps = resolveDefaultProps(Component, props);
19988 var child;
19989
19990 switch (resolvedTag) {
19991 case FunctionComponent:
19992 {
19993 {
19994 validateFunctionComponentInDev(workInProgress, Component);
19995 workInProgress.type = Component = resolveFunctionForHotReloading(Component);
19996 }
19997
19998 child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes);
19999 return child;
20000 }
20001
20002 case ClassComponent:
20003 {
20004 {
20005 workInProgress.type = Component = resolveClassForHotReloading(Component);
20006 }
20007
20008 child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes);
20009 return child;
20010 }
20011
20012 case ForwardRef:
20013 {
20014 {
20015 workInProgress.type = Component = resolveForwardRefForHotReloading(Component);
20016 }
20017
20018 child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes);
20019 return child;
20020 }
20021
20022 case MemoComponent:
20023 {
20024 {
20025 if (workInProgress.type !== workInProgress.elementType) {
20026 var outerPropTypes = Component.propTypes;
20027
20028 if (outerPropTypes) {
20029 checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
20030 'prop', getComponentNameFromType(Component));
20031 }
20032 }
20033 }
20034

Callers 1

beginWorkFunction · 0.70

Calls 13

resolveLazyComponentTagFunction · 0.70
resolveDefaultPropsFunction · 0.70
updateFunctionComponentFunction · 0.70
updateClassComponentFunction · 0.70
updateForwardRefFunction · 0.70
checkPropTypesFunction · 0.70
getComponentNameFromTypeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…