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
davedbaseOP2y 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
davedbaseOP2y 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
davedbaseOP2y 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
davedbaseOP2y 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
davedbaseOP2y ago
Have a look at useIsRouting() with a Show
Raqueebuddin Aziz
Thanks
Want results from more Discord servers?
Add your server