How to insert script to head with app router in RSC? #66089
Unanswered
CaptainN
asked this question in
App Router
Replies: 1 comment
-
Well, React supports this: As long as you provide a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to insert a script tag to the head element, so that it is there in when the HTML loads, but I want to insert that from a layout group's layout (not the root layout). In a root layout, there is
next/document
's head element, but there doesn't seem to be a corresponding element for RSC components (including layout group layouts).next/head
would be obvious to reach for, but it doesn't work.The docs seem to emphasize using direct export meta attributes, but those don't work for 100% of cases - they only really work for predefined use cases. That's not the most flexible tool. Is there a way to insert whatever I want there?
Beta Was this translation helpful? Give feedback.
All reactions