S
SolidJS4d ago
ish

Pattern for "sticky" searchParams?

I have searchParams that I would like to be "sticky" over route changes? I know I could use the current searchParams to contruct the href for many of the links on the page, but I'm wondering if there is a common pattern for this? Thanks.
3 Replies
peerreynders
peerreynders4d ago
I don't now about pattern but I just created a bunch of href helpers that got passed a location which is part of the standard RouteSectionProps passed to route layout components or which can be accessed via useLocation.
GitHub
solid-router/src/types.ts at 1c9eb8ed2cb70e4fa5a53d0d2836fc112e8ac4...
A universal router for Solid inspired by Ember and React Router - solidjs/solid-router
GitHub
solid-start-notes-basic/src/route-path.ts at ef7437d5efa0fd1a2af4bb...
Basic client rendered notes app using SolidStart beta - peerreynders/solid-start-notes-basic
ish
ishOP4d ago
Thanks. I’ll probably have to do similar. Only a subset of my query parameters should be sticky

Did you find this page helpful?