Skip to content

Duplicated script tags when using the new React 19 style tag #75885

Answered by samcx
brijeshb42 asked this question in App Router
Discussion options

You must be logged in to vote

The reason for the duplicated <script> tags is explained thoroughly here → #42170 (comment) (tl;dr, it's because RSC).

Today, the React behavior that handles the ReactDOM.preload style API calls (preloading, hoisting, and deduping) does not apply for elements. This behavior only applies for ReactDOM.preload style API calls, and unfortunately React does not have a similar imperative API for inlined style rules. This isn't necessarily intentional—the primary element-based use case is to have an external stylesheet, which generally isn't unbounded in size, whereas inline style rules can be. It may be possible to extend this React behavior to elements in the future.

What you can do here is se…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@samcx
Comment options

Answer selected by samcx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear: next Confirmed issue that is tracked by the Next.js team. React Related to React.
2 participants
Converted from issue

This discussion was converted from issue #75656 on February 10, 2025 23:05.