Skip to content

Commit 6f77621

Browse files
committed
Remove the warning and add TODOs
1 parent 3a53a84 commit 6f77621

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

packages/react-reconciler/src/ReactFiberBeginWork.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ function updateForwardRef(
220220
nextProps: any,
221221
renderExpirationTime: ExpirationTime,
222222
) {
223+
// TODO: current can be non-null here even if the component
224+
// hasn't yet mounted. This happens after the first render suspends.
225+
// We'll need to figure out if this is fine or can cause issues.
226+
223227
if (__DEV__) {
224228
if (workInProgress.type !== workInProgress.elementType) {
225229
// Lazy component props can't be validated in createElement
@@ -415,6 +419,10 @@ function updateSimpleMemoComponent(
415419
updateExpirationTime,
416420
renderExpirationTime: ExpirationTime,
417421
): null | Fiber {
422+
// TODO: current can be non-null here even if the component
423+
// hasn't yet mounted. This happens when the inner render suspends.
424+
// We'll need to figure out if this is fine or can cause issues.
425+
418426
if (__DEV__) {
419427
if (workInProgress.type !== workInProgress.elementType) {
420428
// Lazy component props can't be validated in createElement

packages/react-reconciler/src/ReactFiberHooks.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,6 @@ function mountWorkInProgressHook(): Hook {
449449

450450
if (__DEV__) {
451451
(hook: any)._debugType = (currentHookNameInDev: any);
452-
if (
453-
currentlyRenderingFiber !== null &&
454-
currentlyRenderingFiber.alternate !== null
455-
) {
456-
warning(
457-
false,
458-
'%s: Rendered more hooks than during the previous render. This is ' +
459-
'not currently supported and may lead to unexpected behavior.',
460-
getComponentName(currentlyRenderingFiber.type),
461-
);
462-
}
463452
}
464453
if (workInProgressHook === null) {
465454
// This is the first hook in the list

0 commit comments

Comments
 (0)