history icon indicating copy to clipboard operation
history copied to clipboard

Add support for `queryHistory`

Open eddiecooro opened this issue 4 years ago • 0 comments

Hey there. I don't know how much this is practical, but it would be great if this library could support a queryHistory. We are developing a react based widget that can be used on many different websites and therefore we can't have any assumptions about how the user uses the hash or the actual pathname of the URL. At first, we were using MemoryRouter, it was great and we didn't have any conflict with the consumer navigation system. But now we need to also have some shareable links so the MemoryRouter is not useful anymore. I was thinking to have a router, which uses a query parameter to handle the routing and I was pretty surprised when I found out that we don't have a package for doing that :smile: What I have in mind, is something like this:

createQueryRouter({
  queryParameterName: "namespaced_path"
})

and then the URL will look like this: /any/path?namespaced_path=/hello /any/path?namespaced_path=/nested/route/like/this

So I want to ask, is there any technical limitation that you can think of, for having this kind of router? if not, I like to try to add this functionality to the library.

eddiecooro avatar Apr 01 '20 14:04 eddiecooro