How to run useMoralisWeb3ApiCall Hook conditional?

I build a frontend where you can enter a wallet address and a contract address into input fields.
I then build the options with:

const [StakingContractParams, setStakingContractParams] =

and then later in onSubmit:

	const onSubmit = (e) => {
		if (!inputs.wallet && !inputs.token) {
			alert("Please choose a token");
		// Set the Params for Staking pool
			chain: "bsc",
			address: inputs.wallet,
			functionName: "userInfo",
			abi: AbiUserInfo,
			params: {
				address: "0x71e0B02eA84C79689d246d32a4ca9dEafdb89829",
				uint256: "2",

the call of the code above is in a seperate “componenten” inserted in the main app.

How can i just run this when there is a valid and complete “StakingContractParams”?

Does providing a live: false as a parameter in your useMoralisWeb3ApiCall stop it from running automatically? If so then you just call fetch() as normal.

Otherwise you could use useMoralisWeb3Api() instead.

If you’re trying to use the result in another component, you can try by lifting state.