Behavior change in streaming logic affects SEO use cases.
The issue reports that React 19.2.0 injects streaming scripts and hidden HTML elements even when using onAllReady for crawlers, potentially impacting SEO. The fix would require modifying the streaming behavior for this specific case, but there's active discussion among maintainers about whether this is actually problematic. The scope is somewhat clear but involves core streaming logic changes.
When using renderToPipeableStream with onAllReady, while also using lazy loading components with React.lazy, React is injecting streaming scripts and hidden HTML elements into the resulting HTML.
React recommends using onAllReady for crawlers, like SEO crawlers, logically, but this new behaviour injects scripts and hidden HTML elements, impacting negatively in SEO scores.
References:
This same issue also occurs with the prerenderToNodeStream API
React version: 19.2.0 React DOM version: 19.2.0
// Button.js
import { createElement } from "react";
const Button = () =>
createElement(
"button",
{
type: "button",
"data-test-button-value1": "some-value-for-test",
"data-test-button-value2": "some-value-for-test",
"data-test-button-value3": "some-value-for-test",
"data-test-button-value4": "some-value-for-test",
"data-test-button-value5": "some-value-for-test",
"data-test-button-value6": "some-value-for-test",
"data-test-button-value7": "some-value-for-test",
"data-test-button-value8": "some-value-for-test",
"data-test-button-value9": "some-value-for-test",
"data-test-button-value10": "some-value-for-test",
"data-test-button-value11": "some-value-for-test",
"data-te
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!