✅ – Alforoan – 03-36 Jan 4
if an api link gives me only one page of a collection of movies and i want multiple pages how do i combine the data?
i can get 2nd,3rd, 4th, etc. pages by changing the link at the end to page=(number)
Solution:Jump to solution
```js
const [currentPage, setCurrentPage] = useState(1);
const FetchMovies = async (page) => {
const response = await fetch(url+page);...
16 Replies
do you want to grab them all at once or when needed?
well actually i suppose i can just copy paste all of them into a data file, right
i wanted to grab them all at once
do you know ahead of time how many pages there are?
💀
![](https://utfs.io/f/8b34177b-6ad9-4b72-b6f6-8fc02c952d1a-1nq2cb.png)
yeah you probably don't want to load all of that at once
i was thinking add a load more button at the bottom
what would you use it all at once for?
ive never done it so i didnt know what u were asking for lol
if you're trying to do a load more
you'd just append the data to your state when you fetch it
so make multiple state hooks?
nah just one
for the fetching part, whats the diff btwn urs and something like this
i'm appending the data to the end of the
list
array whereas you're replacing the array
but you could do it like thisSolution
ok, that's helpful. ty 🙂