S
SolidJS6mo 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
halu6mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
halu6mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
halu6mo ago
I just dont know how well things like this would work with lazy()
halu
halu6mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
halu6mo 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
halu6mo ago
they do work tho idk, I'm open to suggestions
mdynnl
mdynnl5mo 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
halu5mo 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
mdynnl5mo 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
halu5mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
halu
halu5mo 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
halu5mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
Osman
Osman5mo ago
I havent looked further into yet no
halu
halu5mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template