Tips on how to use vue-query with forms?
I have to display a list of users in which some fields will be directly editable
on
the list.
Any tips on how to use vue-query in such cases? I've read https://tkdodo.eu/blog/react-query-and-forms but I'm not using any "forms" framework in Vue and also I'm suspecting there might be better ways to handle that in Vue.React Query and Forms
Forms tend to blur the line between server and client state, so let's see how that plays together with React Query.
3 Replies
unwilling-turquoise•2y ago
I'm looking into this too. Any progress?
quickest-silver•2y ago
Create a component for
editable
field which will have a ref defaulting to data from query. Any edit of this field would change the ref value and then triggering mutation on submit.
That is the general approach. Any specific part you have a problem with.conscious-sapphireOP•2y ago
What I do now is watch
isFetching
for changes and populate a local ref with the query data. Is that what you are saying @MrMentor ?