Is it possible to use <Link> instead of a function to update the url? #536
Answered
by
franky47
LarsFlieger
asked this question in
Q&A
|
Hey everyone, I'm wondering if I can do something like this: export default () => {
const [name, setName] = useQueryState('name')
return (
<>
<h1>{name}</h1>
<Link to="?name='Lars'">}>Set name to Lars.</Link> // <-- SOMETHING LIKE THIS?
</>
)
} |
Answered by
franky47
Apr 1, 2024
Replies: 2 comments 4 replies
|
Yes, also you can use the serializer helper to render query strings from state values the same way the hook would, and feed that to a |
3 replies
|
Hey @franky47 There's some mismatch between docs claiming |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes that would work.
Another tip, if you want to avoid repeating key names and parser config, you can use the same
searchParamsdeclaration object for both the serializer and theuseQueryStateshook: