Changing page-size in getNFTBalances in react

I’m new in moralis and I’m writing a dapp using react and react-moralis. I want to calculate all the NFTs a user has from a specific contract address.
this is how I’m doing it:

const nfts = data.result.filter(nft => nft.token_address === 'xxx');
 return nfts.length;

Am I doing it right? and my main question is that how I can change the page_size in getNFTBalances when using useNFTBalances of react-moralis.

regarding the page size, you can not increase it more than 500, you should use pagination if there are more than 500 entries, pagination can be used with offset parameter (at least in vanilla JS)

1 Like

So how Can I decrease that? Is it possible?

https://docs.moralis.io/moralis-server/web3-sdk/token#getnftowners

for vanilla js there is limit and offset parameters for pagination, it may be something similar in react

1 Like