Skip to content

Instantly share code, notes, and snippets.

@leonnardovv
leonnardovv / react-web3-example.js
Created December 18, 2021 22:49 — forked from dabit3/react-web3-example.js
Example of connecting to an Ethereum wallet using React & Web3
import { useState, useEffect } from 'react'
import Web3 from 'web3'
const [account, setAccount] = useState(null)
let [web3, setWeb3] = useState(null)
useEffect(() => {
checkAccount()
}, [])
// invoke to connect to wallet account