Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear extra nodes if there's a hydration mismatch within a suspense boundary #22592

Merged
merged 2 commits into from
Oct 19, 2021

Commits on Oct 19, 2021

  1. Clear extra nodes if there's a mismatch within a suspense boundary

    This usually happens when we exit out a DOM node but a suspense boundary
    is a virtual DOM node and we didn't do it in that case because we took a
    short cut by calling resetHydrationState directly since we know we won't
    need to pop.
    sebmarkbage committed Oct 19, 2021
    Configuration menu
    Copy the full SHA
    a5062b1 View commit details
    Browse the repository at this point in the history
  2. Tighten up the types of getFirstHydratableChild

    We currently call getFirstHydratableChild to step into the children of
    a suspense boundary. This can be a text node or a suspense boundary
    which isn't compatible with getFirstHydratableChild, and we cheat the type.
    
    This accidentally works because .firstChild always returns null on those
    nodes in the DOM.
    
    This just makes that explicit.
    sebmarkbage committed Oct 19, 2021
    Configuration menu
    Copy the full SHA
    1229123 View commit details
    Browse the repository at this point in the history