-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Memory location does not include a search hook #447
Labels
Comments
That's good point! What do you think about this API: const { hook, searchHook } = memoryLocation({ path: '/foo?key=value' });
<Router hook={hook} searchHook={searchHook}>
// or more explicit
const { hook, searchHook } = memoryLocation({ path: '/foo', searchPath: 'key=value' }); |
Added this to our feature backlog. |
Yeah, returning a |
I'll take this if you'd like! |
Sure, thanks for helping. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using memory location for testing purposes, query params returned by
useSearch
are ignored:I assume this happens because no
searchHook
is passed toRouter
here, butmemoryLocation
does not appear to have one.As a temp workaround, I can swap
useSearch()
with something likeuseLocation()[0].split('?')[1]
or specify my own search hook with the query param built in, but it'd be nice not to.The text was updated successfully, but these errors were encountered: