Ethers V5/useDapp Context Setup
Last updated
Was this helpful?
Last updated
Was this helpful?
We write our components in react-native-web to be compatible with web and mobile platforms.
We use the following packages for the web3 react experience:
native-base
react-native-web
useDapp
ethers (the web3-sdkv2 uses ethers@5)
To use the react hooks SDK (web3sdk-v2 in the ), you'll need to make sure you have the following installed:
Then, you'll need to create a context provider which is a wrapper around:
This is a working configuration when using webpack.
Make sure the components used are not rendered on server side. this can be done by dynamic importing:
This setup is required when using the ethers-v5 compatible SDK's from the
For ethers-v6 sdk's, see the viem/wagmi sdk's documentation for or . Or take a look at the
Share your ideas, or ask for development support. Be sure to check out the For discussion on Discord or various program events: We are also on Telegram: