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

Validate DOM nesting for hydration before the hydration warns / errors #28434

Merged
merged 5 commits into from
Feb 24, 2024

Commits on Feb 23, 2024

  1. Validate DOM nesting for hydration before the hydration warns / errors

    If there's invalid dom nesting, there will be mismatches following but
    the nesting is the most important cause.
    
    We could also silence the mismatch warning (but not thrown error) too.
    sebmarkbage committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    dcdbc5a View commit details
    Browse the repository at this point in the history
  2. Don't warn for immediate follow ups

    This really relies on us throwing to abort hydrating siblings so we don't
    get extra mismatches after.
    sebmarkbage committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    f03b4c4 View commit details
    Browse the repository at this point in the history
  3. Refine the error message slightly to clarify

    That this is according to the rules of HTML, not React, and that this
    will cause a hydration error if not addressed.
    
    "appear as" is a bit academic.
    sebmarkbage committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    1095095 View commit details
    Browse the repository at this point in the history
  4. Move hydration outside the host context of the own instance

    Because otherwise we'll act as if we're already inside the child so
    the child is already inside itself.
    
    I don't think we use the context for anything at runtime.
    sebmarkbage committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    58868bc View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2024

  1. Update tests

    sebmarkbage committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    353871a View commit details
    Browse the repository at this point in the history