[Fast Refresh] Find and remount wrapper edits behind lazy() - #36965
Merged
Conversation
sophiebits
marked this pull request as ready for review
July 8, 2026 07:20
gaearon
reviewed
Jul 8, 2026
| const outerFamily = resolve(payload._result.default); | ||
| if (outerFamily !== undefined && staleFamilies.has(outerFamily)) { | ||
| needsRemount = true; | ||
| } |
Contributor
There was a problem hiding this comment.
Fix seems fine but factoring is a bit odd, since this inner block repeats the previous block (and has same first two conditions). Is there any benefit to unifying them?
gaearon
approved these changes
Jul 8, 2026
sophiebits
force-pushed
the
fresh-type-changes/lazy-wrapper
branch
from
July 8, 2026 15:52
6070edd to
2088495
Compare
sophiebits
force-pushed
the
fresh-type-changes/lazy-wrapper
branch
from
July 8, 2026 16:11
2088495 to
622335b
Compare
sophiebits
force-pushed
the
fresh-type-changes/lazy-wrapper
branch
from
July 8, 2026 16:56
622335b to
bf24070
Compare
hoxyq
approved these changes
Jul 8, 2026
Two bugs: - Type changes to a lazy's inner component (e.g., adding a `memo` comparison function) were missed by the refresh scan. - If a SimpleMemoComponent needs to be remounted, previously resolveRemountTypeForHotReloading would return the inner function and we would incorrectly recreate the fiber as a FunctionComponent. Instead, we can just use elementType consistently now that the beginWork functions consistently call resolveFamily on the wrapped components.
sophiebits
force-pushed
the
fresh-type-changes/lazy-wrapper
branch
from
July 8, 2026 16:58
bf24070 to
c76488d
Compare
hoxyq
approved these changes
Jul 8, 2026
Contributor
Author
|
@hoxyq ty! |
|
Comparing: 4400d6c...c76488d Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
github-actions Bot
pushed a commit
to code/lib-react
that referenced
this pull request
Jul 10, 2026
) Two bugs: - Type changes to a lazy's inner component (e.g., adding a `memo` comparison function) were missed by the refresh scan. - If a SimpleMemoComponent needs to be remounted, previously resolveRemountTypeForHotReloading would return the inner function and we would incorrectly recreate the fiber as a FunctionComponent. Instead, we can just use elementType consistently now that the beginWork functions consistently call resolveFamily on the wrapped components. DiffTrain build for [5123b06](react@5123b06)
github-actions Bot
pushed a commit
to code/lib-react
that referenced
this pull request
Jul 10, 2026
) Two bugs: - Type changes to a lazy's inner component (e.g., adding a `memo` comparison function) were missed by the refresh scan. - If a SimpleMemoComponent needs to be remounted, previously resolveRemountTypeForHotReloading would return the inner function and we would incorrectly recreate the fiber as a FunctionComponent. Instead, we can just use elementType consistently now that the beginWork functions consistently call resolveFamily on the wrapped components. DiffTrain build for [5123b06](react@5123b06)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs:
memocomparison function) were missed by the refresh scan.
resolveRemountTypeForHotReloading would return the inner function
and we would incorrectly recreate the fiber as a FunctionComponent.
Instead, we can just use elementType consistently now that the
beginWork functions consistently call resolveFamily on the wrapped
components.