What should I do if I want to implement optimistic delete? For example:
- My page size is
10. IngetNextPageParam, if thelengthoflastPageis less than10, then returnundefinedto indicate that there's no more data. - The first page is loaded
- I delete one item,
setQueryDatawith 9 remaining items getNextPageParamis called again. NowlastPageonly has9 < 10items, and it doesn't load anymore.
My hack is to replace the deleted item with null or undefined, and skip them when render.