How do I get `<base href='...' />` to the top of the head document returned by createRootRoute?
<head>
<base href='...' />
<Meta />
</head>
It seems like <Meta /> automatically inserts things to <head /> and <base /> ends up getting injected after the <script /> that has a relative route for the build.
7 Replies
other-emerald•8mo ago
are you using start?
old-apricotOP•8mo ago
Yes
other-emerald•8mo ago
right now the only way is to use router.injectHtml outside of react
because in react 19 (which I guess you are using ?) react places the script itself and we can't manipulate that
old-apricotOP•8mo ago
Haven't upgraded to react 19 yet.
other-emerald•8mo ago
btw we have #start-questions for those kind of questions
in react 18 the script should not be moved up
old-apricotOP•8mo ago
I'm sorry I was mistaken react 19 is where I'm seeing this behavior
so router.injectHTMl in client.tsx?
other-emerald•8mo ago
no on the server
router.serverSsr.injectHtml
but that's not a stable API, we will rework it i guess
but you try it out if it works
wait this won't work
you would get a hydration error