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
// we don't require an element to be of type Route,
// but we do require it to contain a truthy path prop.
// this allows to use different components that wrap Route
// inside of a switch, for example .
But the type definitions always require path patterns to extend string or regexp, being truthy isn't enough.
From a quick glance at the code, it seems like it wouldn't break anything if the path was just truthy (for example an object) instead of a string/regexp, provided that the parser handles it correctly. Is the typing needlessly strict in this case?
My use case is emulating the exact: false prop from React Router, so I would imagine Wouter to support something like
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There is a comment in the codebase that says
But the type definitions always require path patterns to extend string or regexp, being truthy isn't enough.
From a quick glance at the code, it seems like it wouldn't break anything if the path was just truthy (for example an object) instead of a string/regexp, provided that the parser handles it correctly. Is the typing needlessly strict in this case?
My use case is emulating the
exact: false
prop from React Router, so I would imagine Wouter to support something likeBeta Was this translation helpful? Give feedback.
All reactions