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...
Смотрите видео Posting Data to Server from React - Query Updates from Mutations онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Leigh Halliday 18 Июнь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 15,844 раз и оно понравилось 603 людям.