Iām trying to initialise my React website with live supply data from my NFT Smart Contract. Functionality works on localhost but not on a deployed website. Any idea why that might be? This is the code that Iām using:
const {
runContractFunction,
data,
error,
isLoading,
isFetching,
} = useApiContract({
address: smartcontractAddress,
functionName: "frontEndTotalSupply",
abi: abinft,
chain: "mumbai"
});
function updateData() {
setValue(data);
}
useEffect(() => {
runContractFunction()
}, [])
useEffect(() => {
data ? updateData() : console.log("Loading...")
}, [data, isFetching, isLoading])