I am getting an error when trying to fetch data from the Moralis database as a cloud function and parse it as a JSON file and displaying it in my component:
import { useMoralis, useMoralisFile, useNewMoralisObject, useMoralisCloudFunction} from "react-moralis"
import {useState, useRef, useEffect} from 'react';
import Item from "./Item"
import { Button } from "@chakra-ui/button";
export const UserItems = () => {
const {data, error, isLoading} = useMoralisCloudFunction("getUserItems")
const list = JSON.parse(JSON.stringify(data))
return (
<>
{list}
</>
)
}
This is the specific error I am getting:
Error: Objects are not valid as a React child (found: object with keys {tokenObjectId, tokenId, tokenAddress, symbol, tokenUri}). If you meant to render a collection of children, use an array instead.
EDIT:
Even when i try to destructure it it gives me an error: [Uncaught Error: A cross-origin error was thrown. React doesnβt have access to the actual error object in development]