const accounts = await web3.eth.getAccounts() //sets the state of the account as a part of the constructor. console.log(accounts)
Id used the above code to display the account information of the user. I have tried with the Main Ethereum network and Ganache, using metamask. Unfortunately, it states the account is undefined. Please help.