S
SolidJS11mo ago
halu

Solid-Router: "named views" equivalent?

What would be the solid-router equivalent of vue-routers "named views"? https://router.vuejs.org/guide/essentials/named-views
{
path: '/',
component: MainLayout,
children: [
{
path: 'home',
components: {
default: Home,
sideBar: DefaultSideBar
,
{
path: 'store',
components: {
default: Store,
sideBar: StoreSideBar
}
}
]
}
{
path: '/',
component: MainLayout,
children: [
{
path: 'home',
components: {
default: Home,
sideBar: DefaultSideBar
,
{
path: 'store',
components: {
default: Store,
sideBar: StoreSideBar
}
}
]
}
Found this, but idk that i want to use a 2 year abandoned repo https://github.com/SupertigerDev/solid-named-router
14 Replies
halu
haluOP11mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
haluOP11mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
haluOP11mo ago
I just dont know how well things like this would work with lazy()
halu
haluOP11mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
haluOP11mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
haluOP11mo ago
they do work tho idk, I'm open to suggestions
mdynnl
mdynnl11mo ago
the first two is really close, you want to render the component instead <views.sideBar {...props} /> but this will rerender all views, you need to store views state and render them instead
halu
haluOP11mo ago
wait, I was under the assumption it would fully re-render as well, does it not? i went for the last option cuz I thought that way would persist the layout between routes, while the first two would not. Then I was thinking I might memoize the sub-views to only update unique view changes.
mdynnl
mdynnl11mo ago
yes, it does. i wasn't sure about the latter i did manage to do it but not really confident about the context/owner tree
halu
haluOP11mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
haluOP11mo ago
@Osman, sounds like we're doing something similar based on ur message here: https://discord.com/channels/722131463138705510/910635844119982080/1210898266758320148 have you found any pattern you like?
halu
haluOP11mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
Osman
Osman11mo ago
I havent looked further into yet no
halu
haluOP10mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
Want results from more Discord servers?
Add your server