Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

With RSC it's common to get React.lazy objects in the children position. This first formats them nicely.

Then it adds introspection support for both lazy and elements.

Unfortunately because of quirks with the hydration mechanism we have to expose it under the name _payload instead of something direct. Also because the name "type" is taken we can't expose the type field on an element neither. That whole algorithm could use a rewrite.

Screenshot 2025-08-07 at 11 37 03 PM Screenshot 2025-08-07 at 11 36 36 PM

For JSX an alternative or additional feature might be instead to jump to the first Instance that was rendered using that JSX. We know that based on the equality of the memoizedProps on the Fiber. It's just a matter of whether we do that eagerly or more lazily when you click but you may not have a match so would be nice to indicate that before you click.

Also fixes a bug with dehydrating thenable

Unfortunately we have to name it _payload instead of aliasing because of how dehydration works.
Unfortunately because of a naming conflict type key is used.
@sebmarkbage sebmarkbage requested review from eps1lon and hoxyq August 8, 2025 03:41
@meta-cla meta-cla bot added the CLA Signed label Aug 8, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Aug 8, 2025
@sebmarkbage sebmarkbage merged commit 59ef3c4 into facebook:main Aug 11, 2025
241 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants