In React you often need to persist data to the server. This video shows how to use react-query mutation functionality to post data to the server, and update the UI with fresh content. We cover three approaches to UI updates, going from easiest but worst performing, to most complicated but best performing.
**Correction**: The return value from onMutate (used when calling rollback()) should be something like this, a function which when called will reset the state back to its previous value: https://github.com/leighhalliday/next...
00:00 - Introduction
01:45 - Querying Data
05:36 - Mutating Data
10:40 - With Refetching Data
12:40 - With Response Cache Update
15:00 - With Optimistic Cache Update
21:00 - Review
Join me on Discord! / discord
Source: https://github.com/leighhalliday/next...
Docs: https://github.com/tannerlinsley/reac...
Watch video Posting Data to Server from React - Query Updates from Mutations online without registration, duration hours minute second in high quality. This video was added by user Leigh Halliday 18 June 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 15,844 once and liked it 603 people.