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
Found this, but idk that i want to use a 2 year abandoned repo https://github.com/SupertigerDev/solid-named-router
14 Replies
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
I just dont know how well things like this would work with lazy()
These ones are just kind of funny:
ignore: https://playground.solidjs.com/anonymous/68e94d2b-ad29-4c8c-b2da-902253ce9a4b
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
Pass obj through children:
https://playground.solidjs.com/anonymous/5f0a86fd-6cd1-45f1-923b-7886355d9fbb
Memo'd:
https://playground.solidjs.com/anonymous/62811b2e-e96e-4cf1-a201-b5268fb59e24
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
they do work tho
idk, I'm open to suggestions
the first two is really close, you want to render the component instead
but this will rerender all views, you need to store views state and render them instead
<views.sideBar {...props} />
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.
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
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
@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?
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
I havent looked further into yet no
Route-Matching in Layout:
https://playground.solidjs.com/anonymous/39c307c1-2580-4c7a-acf6-2697e2348d41
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template