#Render multiple child pages

1 messages · Page 1 of 1 (latest)

stone crescent
#

Hey guys, I'm trying to figure out if it's possible to render multiple child routes simultaneously within the same parent route. Specifically, I want to display the content of two different child routes at the same time on the same page, both nested under a single parent route.

The standard Remix routing model seems to only support rendering one child route at a time in the Outlet of the parent route. I'm wondering if there's a way to achieve this multiple child route rendering within Remix's routing system, or if I need to consider alternative approaches like using components instead of routes, creating custom layouts with multiple Outlets, or implementing client-side routing logic.

Has anyone successfully implemented something like this in Remix? If so, how did you approach it? Are there any best practices or recommended patterns for handling this kind of scenario in Remix applications?

uncut lily
#

Lets talk about the user experience. Routes correspond to URLs. You can nest routes within each other using layout routes and <Outlet>

So if you're rendering two child routes in the same parent, how is the URL going to behave? What happens if I do something in the one nested child route that changes the URL - what happens to the other nested child route? Is it even possible to navigate the child routes independently?

stone crescent
#

I'm build an application that similar to ChatGPT. So I lets say I want this structure: chatgpt (parent route), chatgpt.response and chatgpt.filters; I want to be able to send a new prompt with filters and keep the response. And when i open my filters route, I'm kind of fetching the filters from the backend. So how can I keep my response while, navigating to the filters route?

uncut lily
#

I suppose my question still stands: How do either of the child routes affect the URL? Seems like the chatgpt.response section could actually be a layout and filters is the child route, since the contents of chatgpt.response will be streamed in by some kind of realtime connection, not via the route's loader

stone crescent
#

In theory both Childs could change the URL. One module we are going with Streaming but in another module the .response will have a GET request. So I guess we would need to put the filters in a layout Route

uncut lily
#

But if one child changes the URL, then how will the other child route respond to that URL change?