class AccountList extends React.Component { constructor(props) { super(props); this.state = { error: false, errorMessage: "", accounts: [] }; } async handleClick(e, updateAccountsCallback){ e.preventDefault(); try { updateAccountsCallback(); } catch(err) { this.setState({ error: true, errorMessage: e.name + ': ' + e.message }) } } render(){ return {(context) => (

Get Accounts

{ this.state.error ?
{this.state.errorMessage}
: '' }
await web3.eth.getAccounts();

accounts variable is available in the console

    { context.accounts.map((account, i) =>
  • {account}
  • ) }
)}
; } }