useBeforeLeave or similar for tracking route change in Start

I need to track route changes within Start. Solid Router comes with useBeforeLeave which I can use to track the page the user is moving to however Start doesn't export it. Is everyone else importing router directly in this case?
10 Replies
lxsmnsyc
lxsmnsyc2y ago
I think you can import it directly. useBeforeLeave not being exported by Start seems to be of hindsight given that iirc it is a new feature
davedbase
davedbase2y ago
hmmm, maybe I should put in a PR to export it from start directly
Raqueebuddin Aziz
wait that's a thing? I was using
createEffect(on(() => location.pathname, () => {}))
createEffect(on(() => location.pathname, () => {}))
davedbase
davedbase2y ago
GitHub
GitHub - solidjs/solid-router: A universal router for Solid inspire...
A universal router for Solid inspired by Ember and React Router - GitHub - solidjs/solid-router: A universal router for Solid inspired by Ember and React Router
davedbase
davedbase2y ago
Lots of goodies there. Start uses it under the hood it just doesn't expose some of the primitives
Raqueebuddin Aziz
Thanks routing triggers suspense? to show a loader for fallback
davedbase
davedbase2y ago
I don't believe routing triggers suspense on its own, a promise or resource would though.
Raqueebuddin Aziz
Is there a way to show a fallback while routing is taking place?
davedbase
davedbase2y ago
Have a look at useIsRouting() with a Show
Raqueebuddin Aziz
Thanks