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

Revert to client render on text mismatch #23354

Merged
merged 2 commits into from
Feb 24, 2022

Commits on Feb 24, 2022

  1. Refactor warnForTextDifference

    We're going to fork the behavior of this function between concurrent
    roots and legacy roots.
    
    The legacy behavior is to warn in dev when the text mismatches during
    hydration. In concurrent roots, we'll log a recoverable error and revert
    to client rendering. That means this is no longer a development-only
    function — it affects the prod behavior, too.
    
    I haven't changed any behavior in this commit. I only rearranged the
    code slightly so that the dev environment check is inside the body
    instead of around the function call. I also threaded through an
    isConcurrentMode argument.
    acdlite committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    5d70f7a View commit details
    Browse the repository at this point in the history
  2. Revert to client render on text content mismatch

    Expands the behavior of enableClientRenderFallbackOnHydrationMismatch to
    check text content, too.
    
    If the text is different from what was rendered on the server, we will
    recover the UI by falling back to client rendering, up to the nearest
    Suspense boundary.
    acdlite committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    e55142d View commit details
    Browse the repository at this point in the history