taro-28 / tanstack-table-search-params

React Hook for syncing TanStack Table state with URL search params.
https://github.com/taro-28/tanstack-table-search-params
9 stars 0 forks source link

Support for alternative routers (for example TanStack Router) #13

Closed ChristopherHaws closed 2 weeks ago

ChristopherHaws commented 1 month ago

Hey! This library is exactly what I am looking for, but we don't use NextJS, we use Tanstack Router with client-side routing. Any chance the router types can be abstracted to allow for different state storage implementations? Some other implementations which could be useful are local or session storage.

Here is a link to their sample project which shows how this can be done with Tanstack Router:

I would be happy to contribute the change, but I would need to know which direction you would want to take with the implementation - primarily if you would want the nextjs and tanstack router implementations to be packaged in separate packages or just as submodules of the core package with optional peer dependencies.

Thanks!

taro-28 commented 1 month ago

@ChristopherHaws

Hello! Thank you for finding this unfinished project! (I apologize for the delayed response as well.)

I will try to see if I can make it compatible with TanStack Router, so please wait a little longer!

taro-28 commented 1 month ago

I've confirmed that the following implementation still works with TanStack Router, but what do you think?

https://github.com/taro-28/tanstack-table-search-params/blob/a9c3ddf68ea52f8aea4120d13a30726f0df89f54/examples/tanstack-router/src/routes/index.tsx#L16-L42

However, honestly, passing search to navigate isn't as straightforward as I'd like, so I'm planning to come up with another solution eventually. 🙏