S
SolidJS•2y ago
Bersaelor

[Solid-start]FileRoutes] is there a way of using two separate Routes folders in `root.tsx`

E.g., my main content should be Client-Side rendered, but the headers should be server side rendered for every route,s o what I would like to do is:
[root.tsx]


return <Html lang="en">
<Head>
<Routes>
<FileRoutes folder='headers' />
</Routes>
</Head>
<Body>
<ClientOnly>
<AuthContextProvider>
<AppContextProvider>
<Routes>
<FileRoutes folder='content' />
</Routes>
</AppContextProvider>
</AuthContextProvider>
</ClientOnly>
</Body>
</Html>
[root.tsx]


return <Html lang="en">
<Head>
<Routes>
<FileRoutes folder='headers' />
</Routes>
</Head>
<Body>
<ClientOnly>
<AuthContextProvider>
<AppContextProvider>
<Routes>
<FileRoutes folder='content' />
</Routes>
</AppContextProvider>
</AuthContextProvider>
</ClientOnly>
</Body>
</Html>
4 Replies
mdynnl
mdynnl•2y ago
not that I'm aware, i think it's better to use ClientOnly on the route level like route group or route component
Bersaelor
BersaelorOP•2y ago
So, the problem I had with <ClientOnly> on the root level, was that the <AppContextProvider> then had to also be in both routes, which meant two separate contexts. And the fact that I have UI Elements that should be <ClientOnly> that are reused in different routes and should stay on screen
mdynnl
mdynnl•2y ago
haven't tracked the messages in #general so i dont quite follow but the context can be in top level, also seen a couple thread from you, most of em seems like XY problem to me, you could make another thread with your setup and data flow 🤣 meanwhile i'll try to follow the conversation cuz i'm on the bus
Bersaelor
BersaelorOP•2y ago
yeah, I was tryint multiple different approaches at the same time. this idea here of having two separate routes is clearly not possible
Want results from more Discord servers?
Add your server