const { data } = useSWR(`/api/data?page=${pageIndex}`, fetcher);. Notice how data is fetched based on pageIndex variable, that comes from the state.
確定! 回上一頁