You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.
Hey everyone, I wanted to throw out a quick idea that may reduce some of the boilerplate when defining our routes.
It's pretty common to define a route like this, possibly many times, that is meant to match some kind of number:
<Routecomponent={userPage}path="user/:id(\d+)/"/>
After a while, it get's tedious to add these regexes to our routes, and also reduces readability. Maybe instead we could still allow for a regex, but also provide some default "types":
Hey @mthadley, this does indeed seem interesting, but I haven't been able to find a similar approach out there int he wild. All of them seem to just rely on regexes for this.
I'd be more comfortable if there is already a pattern for this out there, so we don't need to come up with our own format. Do you know of any such cases?
Hey everyone, I wanted to throw out a quick idea that may reduce some of the boilerplate when defining our routes.
It's pretty common to define a route like this, possibly many times, that is meant to match some kind of
number
:After a while, it get's tedious to add these regexes to our routes, and also reduces readability. Maybe instead we could still allow for a regex, but also provide some default "types":
The syntax is subject to change, but I think it would at least be useful for parsing numbers. Possible other things like booleans as well.
Thanks!
The text was updated successfully, but these errors were encountered: