freeatnet
web3-react-simple-app
TypeScript

A simple app to get started with web3-react (https://github.com/NoahZinsmeister/web3-react)

Last updated Jan 25, 2024
28
Stars
1
Forks
0
Issues
0
Stars/day
Attention Score
10
Language breakdown
No language data available.
Files click to expand
README

web3-react-simple-app

This is a simple, structured sample of using web3-react.

The app fetches the block number and some basic information about DAI token, demonstrating use of basic functions and contract interactions.

Use-cases

The app demonstrates the following use-cases:

  • A MetaMask user who has previously authorized the app will be automatically signed in with their current account if their MetaMask is unlocked.
  • Otherwise:
* the user will be connected to the Ethereum network using a NetworkConnector to retrieve the block number and basic information about DAI token; * the user will be presented with a "Connect with MetaMask" button that allows them to unlock / connect their account.
  • Should the user unlock their MetaMask while on the website, the app will not change state until the user clicks "Connect with MetaMask".
  • Should the user lock their MetaMask while on the website, they will be logged out of the app automatically.

Show me the code

See features/web3 for the web3-react setup. Note that Web3Provider wraps App in index.tsx, and a Web3ConnectionManager wraps the rest of the app in App.tsx.

Notes

Other web3-react Projects

  • https://github.com/aragon/use-wallet: All-in-one solution to connect a dapp to an Ethereum provider.

Contributing

Feel like you can improve this example? PRs are welcome! Just remember that this is intended as starter code. :)

Contributors & Acknowledgements

Contributors:

Wouldn't be possible without:

License

See UNLICENSE for details.

© 2026 GitRepoTrend · freeatnet/web3-react-simple-app · Updated daily from GitHub