Fork me on GitHub
#fulcro
<
2023-09-06
>
Harry00:09:49

I have some :href "#abc" on my homepage, however if you go off the home page and then refresh, it resets the actual routing but not the url and hence these no longer function correctly. Is there a way to reset the url on refresh, short of changing the href to a route-to? I am using the rad routing from the demo project.

2
Jakub Holý (HolyJak)11:09:04

What do you mean by > go off the home page and then refresh ? You navigate to a different page and than hard-reload that page???

Harry12:09:19

Yeah if I hard-reload, it resets the page back to the home page, but not the url ie http://example.com/test on refresh would still be http://example.com/test but the actual content would be http://example.com

Jakub Holý (HolyJak)12:09:54

If you hard reload on a url then of course the URL stays the same. What the RAD Demo does is that it checks the url and updates routing accordingly, see https://github.com/fulcrologic/fulcro-rad-demo/blob/5e40e596a2fb1922f3c4dc20e944d441d6025c40/src/shared/com/example/client.cljs#L34 Is this somehow not working for you?

tony.kay14:09:21

I just discussed this in the thread above. Routing in Fulcro is meant to be generic across platforms (native does not have URLs). If you want to integrate with browser-specific features you have to do that separately. RAD is the only library set that has pre-written implementation for that (as a plugin).

Harry00:09:03

Ahh worked it out, I have all the authentication stuff removed and hence fix-route wasn't being run. Ended up just (routing/route-to! app welcome/Welcome {}) before the app/mount! Thanks guys!