Skip to content

[React 19] Hydration appending RSC component to body #31646

Closed as not planned
Closed as not planned
@mayansharma

Description

@mayansharma

Summary

Consuming RSC payload in a component using createFromFetch causing the response to get appended in the DOM instead of replacing if not wrapped with Suspense

const RouteWrapper = () => {
  const location = useLocation();
  const [rscContent, setRscContent] = useState(null);

  useEffect(() => {
    const content = createFromFetch(
      fetch("/rsc?location=" + location.pathname),
      {
        callServer,
      }
    );
    setRscContent(content);
  }, [location.pathname]);

  return rscContent
};

Link to repositories

  1. Hydration appending RSC response to body - https://github.com/tata1mg/catalyst-core/tree/hydration-error
  2. Hydration causing mismatch - https://github.com/tata1mg/catalyst-core/tree/rsc-demo-routing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions