Disconnect MetaMask from a React dApp

InstructorRyan Harris

Share this video with your friends

Send Tweet

Users should also be given the option to disconnect their wallet from your dApp.

There isn’t a programatic way to accomplish this, but we can remove their wallet address from state, adjust the UI, and use react-router to navigate them to root in order to provide a clear UX.