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
Also I have to manually check the type of the params. I have a component for /users/:numericId, I have to check if numericId is an integer, and to redirect to 404 page if its not.
The router should not match /users/:numericId if /users/apha were provided.
As an example of type annotations for route params, Flask (server-side Python web framework) allows this:
I guess having type annotation on route parameters is helpful for two reasons.
A request for
/users/staff
hits the first second route instead of the third.Having annotations like
<Route path="/users/<id:int>"/>
could have prevented this.I have to arrange stuff like:
Also I have to manually check the type of the params. I have a component for
/users/:numericId
, I have to check if numericId is an integer, and to redirect to 404 page if its not.The router should not match
/users/:numericId
if/users/apha
were provided.As an example of type annotations for route params, Flask (server-side Python web framework) allows this:
The text was updated successfully, but these errors were encountered: