This is a simple example how to create a MetaMask wallet connect button in a React application. It implements the following functionality:
- Allows user to trigger MetaMask's onboarding process (i.e. forwards user to MetaMask's download page), if MetaMask is not installed
- Disables button on click
- Button text displays the current connected account address in the format 0x1234...abcd
- Account address in button changes when user connects to a different account
Download the repositry via git clone https://github.com/Walodja1987/WalletConnectButton
Install the dependencies (one-off after download) via
npm install
Start the application via
npm start
You need to have npm installed in order to run above commands. If you don't have it, download it from here: Make sure you have npm installed. If not, head over to this page: https://nodejs.org/en/download/