Calling a View function in react

I cannot read data from the blockchain using the moralis useWeb3ExecuteFunction in react…
this is the code:

import React from "react";

import { useMoralis } from "react-moralis";

import { useParams } from "react-router";

import circle from "../../Images/circle.svg";

import { Button } from "antd";

import Sblockie from "components/Sblockie";

import { useWeb3ExecuteFunction } from "react-moralis"

export default function MobileUserPage() {

  const { id } = useParams();

  const { isWeb3Enabled, isAuthenticated, account } =

    useMoralis();

  if (isAuthenticated && isWeb3Enabled && id==account) {

    return (

    <div>

      <div

        style={{

          display: "grid",

          gridTemplateColumns: "repeat(3, 1fr)",

          gap: "20px",

        }

        }

      >

        <div></div>

        <div>

        <div

            style={{

            display: "grid",

            gridTemplateColumns: "repeat(3, 1fr)",

            gap: "20px",

            }

            }

            >

                <div>

                    <Sblockie currentWallet scale={20} />

                </div>

                <div>

                    <Button

                        style={{

                            display: "block",

                            marginLeft: "auto",

                            marginRight: "auto"

                        }}

                    >Create Fundme!</Button>

                </div>

            </div>

          <h1 style={{

            lineHeight: "1.2",

            marginTop: "30px",

            marginBottom: "30px",

            fontSize: "20px",

          }}

          >{id}</h1>

        </div>

        <div>

          <img

            src={circle}

            style={{

              width: "20%",

              marginRight: "100px"

            }}

          />

          <h2

          style={{

            textAlign: "center",

          }}

          >0/1</h2>

        </div>

      </div>

    </div>

    )

  } else {

    return (

      <div>

      <div

        style={{

          display: "grid",

          gridTemplateColumns: "repeat(3, 1fr)",

          gap: "20px",

        }

        }

      >

        <div>

        <div

            style={{

            display: "grid",

            gridTemplateColumns: "repeat(3, 1fr)",

            gap: "20px",

            }

            }

            >

                <div>

                    <Sblockie currentWallet scale={20} />

                </div>

            </div>

          <h1 style={{

            lineHeight: "1.2",

            marginTop: "30px",

            marginBottom: "30px",

            fontSize: "20px",

          }}

          >{id}</h1>

        </div>

       

        <div style={{

          display: "grid",

          gridTemplateColumns: "repeat(2, 1fr)",

          gap: "20px",

        }

        }

        >

          <div>

            <div className="dot2"></div>

            <div className="dot"><h2

            style={{  

              display: "flex",

              marginLeft: "auto",

              marginRight: "auto",

              marginTop: "auto",

              marginBottom: "auto",

              textAlign: "center"

            }}

            >{ActiveFundme()}/1</h2></div>

          </div>

          <div>

            <div className="dot2"></div>

            <div className="dot"><h2

            style={{  

              display: "flex",

              marginLeft: "auto",

              marginRight: "auto",

              marginTop: "auto",

              marginBottom: "auto",

              textAlign: "center"

            }}

            >{AmountDonated()}</h2></div>

          </div>

        </div>

        <div></div>

      </div>

    </div>

    )

  }

}

async function ActiveFundme(){

  const processor = useWeb3ExecuteFunction();

  const { id } = useParams();

  const ABI = [

    {

      "inputs": [

        {

          "internalType": "address",

          "name": "_user",

          "type": "address"

        }

      ],

      "name": "GetactiveFundme",

      "outputs": [

        {

          "internalType": "bool",

          "name": "",

          "type": "bool"

        }

      ],

      "stateMutability": "view",

      "type": "function"

    },

   

  ]

  const activeornote = {

      chainin: "matic",

      contractAddress: "0x4ca23e9584cc784814180fcf08f72b5d94ca5379",

      functionName: "GetactiveFundme",

      abi: ABI,

    params:{

      _user: {id}

    }

  };

  await processor.fetch({

    params: activeornote

  })

  return 0;

}

async function AmountDonated(){

  const processor=useWeb3ExecuteFunction();

  const {id} = useParams();

  const ABI = [

    {

      "inputs": [

        {

          "internalType": "address",

          "name": "_user",

          "type": "address"

        }

      ],

      "name": "GetAmountDonated",

      "outputs": [

        {

          "internalType": "uint256",

          "name": "",

          "type": "uint256"

        }

      ],

      "stateMutability": "view",

      "type": "function"

    },

  ]

  const amountdonatedd = {

    chainin: "matic",

    contractAddress: "0x4ca23e9584cc784814180fcf08f72b5d94ca5379",

    functionName: "GetAmountDonated",

    abi: ABI,

    params:{

    _user: {id}

  }

  };

  await processor.fetch({

    params: amountdonatedd

  })

}

and a white screen comes out in the localhost

You can see here how to format code on forum:

If you’re trying to read data, I’ll suggest you use runContractFunction[ https://docs.moralis.io/moralis-dapp/web3-api/native#runcontractfunction ] instead of useWeb3ExecuteFunction as useWeb3ExecuteFunction will require web3 enabled

I tried to use that function but the result doesn’t change, returns “null” value
this is the code:

import React from "react";

import { useMoralis } from "react-moralis";

import { useParams } from "react-router";

import circle from "../../Images/circle.svg";

import { Button } from "antd";

import Sblockie from "components/Sblockie";

import { useMoralisWeb3Api ,useMoralisWeb3ApiCall } from "react-moralis"

export default function MobileUserPage() {

  const ActiveFundme = () => {

    const {native} = useMoralisWeb3Api();

    const ABI = [

      {

        "inputs": [

          {

            "internalType": "address",

            "name": "_user",

            "type": "address"

          }

        ],

        "name": "GetactiveFundme",

        "outputs": [

          {

            "internalType": "bool",

            "name": "",

            "type": "bool"

          }

        ],

        "stateMutability": "view",

        "type": "function"

      },

     

    ]

    const options = {

      chain: "matic",

      address: "0x4Ca23e9584cC784814180fCF08f72B5d94ca5379",

      function_name: "GetactiveFundme",

      abi: ABI,

      params: { _user: {id} },

    };

    const {data} = useMoralisWeb3ApiCall(

      native.runContractFunction,

      { ...options }

    );

    return JSON.stringify(data);

  }

  const { id } = useParams();

  const { isWeb3Enabled, isAuthenticated, account } =

    useMoralis();

  if (isAuthenticated && isWeb3Enabled && id==account) {

    return (

    <div>

      <div

        style={{

          display: "grid",

          gridTemplateColumns: "repeat(3, 1fr)",

          gap: "20px",

        }

        }

      >

        <div></div>

        <div>

        <div

            style={{

            display: "grid",

            gridTemplateColumns: "repeat(3, 1fr)",

            gap: "20px",

            }

            }

            >

                <div>

                    <Sblockie currentWallet scale={20} />

                </div>

                <div>

                    <Button

                        style={{

                            display: "block",

                            marginLeft: "auto",

                            marginRight: "auto"

                        }}

                    >Create Fundme!</Button>

                </div>

            </div>

          <h1 style={{

            lineHeight: "1.2",

            marginTop: "30px",

            marginBottom: "30px",

            fontSize: "20px",

          }}

          >{id}</h1>

        </div>

        <div>

          <img

            src={circle}

            style={{

              width: "20%",

              marginRight: "100px"

            }}

          />

          <h2

          style={{

            textAlign: "center",

          }}

          >0/1</h2>

        </div>

      </div>

    </div>

    )

  } else {

    return (

      <div>

      <div

        style={{

          display: "grid",

          gridTemplateColumns: "repeat(3, 1fr)",

          gap: "20px",

        }

        }

      >

        <div>

        <div

            style={{

            display: "grid",

            gridTemplateColumns: "repeat(3, 1fr)",

            gap: "20px",

            }

            }

            >

                <div>

                    <Sblockie currentWallet scale={20} />

                </div>

            </div>

          <h1 style={{

            lineHeight: "1.2",

            marginTop: "30px",

            marginBottom: "30px",

            fontSize: "20px",

          }}

          >{id}</h1>

        </div>

       

        <div style={{

          display: "grid",

          gridTemplateColumns: "repeat(2, 1fr)",

          gap: "20px",

        }

        }

        >

          <div>

            <div className="dot2"></div>

            <div className="dot"><h2

            style={{  

              display: "flex",

              marginLeft: "auto",

              marginRight: "auto",

              marginTop: "auto",

              marginBottom: "auto",

              textAlign: "center"

            }}

            >{ActiveFundme()}/1</h2></div>

          </div>

          <div>

            <div className="dot2"></div>

            <div className="dot"><h2

            style={{  

              display: "flex",

              marginLeft: "auto",

              marginRight: "auto",

              marginTop: "auto",

              marginBottom: "auto",

              textAlign: "center"

            }}

            ></h2></div>

          </div>

        </div>

        <div></div>

      </div>

    </div>

    )

  }

}

According to your abi, the value for _user is meant to be an address