Asking about the _page=${page}&_limit=${PAGE_SIZE + 1}
when trying to use my own API or JSON FILE
const fetch = async () => {
axios
.get(
`https://jsonplaceholder.typicode.com/posts?_page=${page}&_limit=${
PAGE_SIZE + 1
}`
)
.then((response) => {
const data = response.data;
const items = response.data.slice(0, 8);
setHasMore(data.length > PAGE_SIZE);
if (posts.length === 0) {
setPosts(items);
} else {
setPosts((v) => [...v, ...items]);
}
})
.finally(() => {
if (!bootstrapped) {
setBootstrapped(true);
}
});
};`