detect-provider
detect-provider copied to clipboard
(WARNING) MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.
The code:
useEffect(() => {
const loadProvider =async () => {
const provider = await detectEthereumProvider()
if (provider) {
const web3 = new Web3(provider);
setWeb3Api({
provider: provider,
web3: web3,
contract: null,
isLoading: false
});
} else {
setWeb3Api({
...web3Api,
isLoading: false
});
console.error('Please install MetaMask!')
}
}
loadProvider();
}, [])

Hi @rhythmshandlya, so sorry that it's taken us so long to respond to this. If you're still having issues would you mind telling us whether you're still seeing this error and which library you're using (i.e. where does Web3 come from)? Thanks.