pateketrueke/yrv

How to use hash based routes

AndreasHald opened this issue · 7 comments

I have a simple route setup, that i can't get to work.

/foos
/foo/:id

<Route exact path="/foos" component={foosComponent} /> <Route exact path="/foo/:id" component={fooComponent} /> <Route fallback>404 Not found</Route>

Foos is a list
Foo refers to a specific item.

When i'm on a specific item i would like to use fragment based routing to allow the user to scroll to certain items on the page, however the router thinks it's a route attempt and redirects to the fallback.

so /foo/123#someItem takes me to the fallback route

how do i define the route for foo so that it optionally can have a fragment parameter? and stays on the same component?

Oh my fault, it was a bug I closed few weeks ago but never released, sorry for that.

Please upgrade to the 0.0.31 version, it fixes the default anchor behavior.

I seem to be having an issue on 0.0.31 any ideas what could cause this?

Screenshot 2020-09-23 at 19 13 09

You're right, my fault again, let me figure out what happened!

Please try again, It seems to still failing on the Svelte REPL, but may works for you, please let me know!

0.0.32 runs successfully, unfortunately nothing is rendered on any route.

Yeah, I found the root-cause, is a thing of the building setup — I almost fixed it last night, I think it'll be ready soon...

Fixed on v0.0.33 — feel free to open a new issue if this is not working as you're expecting, thank you!