State Management · Middle · Question 67 of 75
Which SWR hook implements "load more" pagination?
- ✓Correct answer:
useSWRInfinite - 2
useSWRMutation - 3
useSWRImmutable
Explanation
You provide getKey(pageIndex, previousPageData), and setSize(size + 1) loads the next page. Return null to stop when there are no more pages.