Query Params syncronization #8126
Answered
by
Moshyfawn
MursalovAltun
asked this question in
Ideas
-
Wouldn't it be useful for many users of this library to have an ability to synchronize form's value with the query params. This is very useful when you have a form for filtering a list of data. |
Beta Was this translation helpful? Give feedback.
Answered by
Moshyfawn
Apr 2, 2022
Replies: 1 comment 5 replies
-
You can simply watch your form values in a headless component and update the URL as a side-effect inside const SyncDataUrl = () => {
const data = useWatch()
useEffect(() => {
updateUrl(data)
}, [data, updateUrl])
return null
} I doubt this feature is gonna be included out of the box, as it's out of the scope of this library. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
bluebill1049
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can simply watch your form values in a headless component and update the URL as a side-effect inside
useEffect
accordingly.I doubt this feature is gonna be included out of the box, as it's out of the scope of this library.