/**
* This is the source code of react version 8.2
* I omitted part of the code
* Through debugging, I found that renderwithhooks was executed twice, and there was no difference between the two executions. Why did you do this? I understand that this is a bug
*/
function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) {
// ...
value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); /* first */
hasId = checkDidRenderIdHook();
workInProgress.flags |= PerformedWork;
if ( typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
// ...
} else {
workInProgress.tag = FunctionComponent;
{
if ( workInProgress.mode & StrictLegacyMode) {
try {
value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); /* second */
hasId = checkDidRenderIdHook();
} finally {
setIsStrictModeForDevtools(false);
}
}
}
return workInProgress.child;
}
}