-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Adds scope
prop to LocationProvider
, limiting link intercepts
#42
Conversation
limit
prop to LocationProvider
, limiting link intercepts
README.md
Outdated
@@ -82,6 +82,10 @@ export async function prerender(data) { | |||
|
|||
A context provider that provides the current location to its children. This is required for the router to function. | |||
|
|||
Props: | |||
|
|||
- `limit?: string | RegExp` - Sets a limit on the paths that the router will handle (intercept). If a path does not match the limit, either by starting with the provided string or matching the RegExp, the router will ignore it and default browser navigation will apply. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name limit bothers me a bit, I would prefer something like include/exclude personally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, "include" means something quite different though. To include something is to have it be part of a whole; this limits the whole to only the matching value.
There's probably a better name somewhere (haven't yet found/thought of one myself), though I think "include" would give a very different idea than what we're going for. Just my initial thoughts though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe scope
? I'm not dead-set against include
, can do it, though not my fav.
limit
prop to LocationProvider
, limiting link interceptsscope
prop to LocationProvider
, limiting link intercepts
1ace85d
to
86a173e
Compare
Closes #34
Allows users to opt-out of link interception, setting a string & regexp scope that intercepts should be limited to, e.g.,
<LocationProvider scope="/app">
will ignore clicks to/site
.