PUT request with controlled form
Hi, I don't know how to perform a PUT request with RQ, everything I found indicates use of React Hook Form, whereas the project I am on doesn't have it, how would I be able to insert the values into
useState so that I can put them inside an input's value prop and update them with PUT4 Replies
yappiest-sapphire•4y ago
That's a quite generic question that doesn't give enough context to answer properly. The standard answer would be: react-query doesn't actually make the requests for you, so it doesn't care if it's put, post or get. You definitely want to look into mutations. You certainly don't have to use a form library, but react-query also doesn't manage the form state for you, as this is client state.
ratty-blushOP•4y ago
This is what I have so far, though each time the
id changes now, where ever I inserted formValue.name instead of data[0].name it wouldn't refresh, so the first person you got, their name would remain even when you change the id and get a new useryappiest-sapphire•4y ago
okay this is literally the same question as this: https://discord.com/channels/719702312431386674/1020362705590296607/1020362705590296607
ratty-blushOP•4y ago
Cool, I shall take a look and try and integrate it, thank you