-
Notifications
You must be signed in to change notification settings - Fork 43
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
Routes with missing optional parameters do not work without a trailing slash (/) #40
Comments
Actually, upon further testing, it seems there are times where the routes with optional params aren't matching at all, regardless of whether there is a trailing slash |
Oof, sorry for the inconvenience! Well caught! As for the second problem, I presume this is the same problem as addressed in issue #39. Which I'm having some trouble with when it comes to consistently reproducing. So far my only hunch is that some weird optimization in SwiftUI 3 kicks in at a random time and decides to not call the But the key problem here is that I'm unable to consistently reproduce this problem... Even when making this example I only encountered this problem once, and have been unable to reproduce it since. So if anyone has a sample project or knows the steps to consistently activate this odd behaviour, I'd be most grateful 🙏 |
Okay let's try that again. The first addressed issue should be fixed in the branch |
Hey! Great work on this library. Really hope it takes off more because it really is a great solution for routing in SwiftUI.
A minor bug I noticed is that while wildcards do not rely on trailing slashes, optional parameters do. So for example, I had
Route("/chats/*")
which would render regardless of whether I was going to
/chats
or/chats/:chatID
. However, if I redefine this as/chats/:chatID?
, then navigating to/chats
produces an empty screen. Only if I navigate to/chats/
will the SwiftUI component appear.It's a minor regex fix I imagine, but nevertheless thought I'd raise it. I can help open a fix if you don't have the time :)
The text was updated successfully, but these errors were encountered: