-
Notifications
You must be signed in to change notification settings - Fork 540
Description
Is your request related to a problem?
Not really. Missing a discussion board for best practices so I am opening here to get guidance on where to post usage questions.
Feature Description
What is the recommended way to reload the app after chain / wallet switches / disconnect ?
Alternative Solutions
- catching window.ethereum events
window.ethereum.on('accountsChanged', (accounts: any) => { console.log('accountsChanged. Reloading') window.location.reload(); }); window.ethereum.on('chainChanged', (chainId: any) => { console.log('chainChanged. Reloading') window.location.reload(); }); window.ethereum.on('disconnect', (accounts: any) => { console.log('disconnect. Reloading') window.location.reload(); });
-
subscride to wallet updates adding a flag to prevent infinite loop of first rendering (React)
const wallets2 = web3Onboard.state.select('wallets')
wallets.subscribe(wallet => { ... ))
Anything else?
A discussions board would help adopters. Github has a discussions tab itself. Stackoverflow has only one ticket open https://stackoverflow.com/questions/tagged/web3-onboard