Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional params #41

Open
Daarien opened this issue Apr 18, 2020 · 3 comments
Open

Optional params #41

Daarien opened this issue Apr 18, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@Daarien
Copy link

Daarien commented Apr 18, 2020

"abstract-nested-router" docs say (of params):
"By default all segments are optional, e.g. /a/:b/:c matches with /a, /a/x and /a/x/y so you can say :b and :c are optional parameters."

For "yrv" it is not so. If i need a page with optional params, i have to declare three routes, one for each case:

<Route path="/page/:x/:y">Page</Route>
<Route path="/page/:x">Page</Route>
<Route path="/page">Page</Route>

I need the same component with params based on current path.

Could it be made as in "abstract-nested-router"?

@Daarien
Copy link
Author

Daarien commented Apr 18, 2020

When i experiment with "/page/:x?/:y?" sometimes it works, but a few moves later i get clean white screen.

@pateketrueke
Copy link
Owner

Could it be made as in "abstract-nested-router"?

You're right, that functionality was lost, thanks for your feedback!

@Daarien
Copy link
Author

Daarien commented Apr 20, 2020

One more unpleasant thing.
When navigating to page from outside, first level optional param path like "/page/(:param)" works, but when start navigating from inside this page, optional param stop working.

Example
https://svelte.dev/repl/3678130b9358496eabf8c84aabf7f2c3?version=3.20.1

@pateketrueke pateketrueke added the bug Something isn't working label Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants