Concurrent Request

By default, the latest request data will overwrite the last request data. This may cause the status to be overwritten when performing updates or deletions on some lists.

In the following example, you can try to click a button, and you will find that the state of all the buttons has changed, which is unreasonable.

Therefore, when encountering similar problems as above, you can set queryKey() to manage the status of each request individually, and then use queries to access the data of each item.

queryKey() will take the parameter of Request Method as the input parameter. You only need to return a string (make sure the string is unique in the concurrent list).

Last Updated: 9/4/2021, 2:55:54 PM
Contributors: John