Skip to content

Commit

Permalink
Remove the warning and add TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Feb 12, 2019
1 parent 3a53a84 commit 6f77621
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
8 changes: 8 additions & 0 deletions packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ function updateForwardRef(
nextProps: any,
renderExpirationTime: ExpirationTime,
) {
// TODO: current can be non-null here even if the component
// hasn't yet mounted. This happens after the first render suspends.
// We'll need to figure out if this is fine or can cause issues.

if (__DEV__) {
if (workInProgress.type !== workInProgress.elementType) {
// Lazy component props can't be validated in createElement
Expand Down Expand Up @@ -415,6 +419,10 @@ function updateSimpleMemoComponent(
updateExpirationTime,
renderExpirationTime: ExpirationTime,
): null | Fiber {
// TODO: current can be non-null here even if the component
// hasn't yet mounted. This happens when the inner render suspends.
// We'll need to figure out if this is fine or can cause issues.

if (__DEV__) {
if (workInProgress.type !== workInProgress.elementType) {
// Lazy component props can't be validated in createElement
Expand Down
11 changes: 0 additions & 11 deletions packages/react-reconciler/src/ReactFiberHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,17 +449,6 @@ function mountWorkInProgressHook(): Hook {

if (__DEV__) {
(hook: any)._debugType = (currentHookNameInDev: any);
if (
currentlyRenderingFiber !== null &&
currentlyRenderingFiber.alternate !== null
) {
warning(
false,
'%s: Rendered more hooks than during the previous render. This is ' +
'not currently supported and may lead to unexpected behavior.',
getComponentName(currentlyRenderingFiber.type),
);
}
}
if (workInProgressHook === null) {
// This is the first hook in the list
Expand Down

0 comments on commit 6f77621

Please sign in to comment.