A minimal reproduction demo for SDK bug reported in thirdweb-dev/js#7654
This repository demonstrates an issue with wallet disconnection when using thirdweb in a React + Vite setup with react-router-dom. Specifically, it reproduces a bug where the connected wallet gets disconnected upon page reload after navigating to a new route.
Problem:
When using @thirdweb-dev/react with react-router-dom, the connected wallet (e.g., MetaMask, Rainbow, or social login) disconnects after a route change followed by a page reload. This issue affects user experience, especially in single-page applications where routing is commonly used.
-
Clone this repository:
git clone https://github.com/[your-username]/thirdweb-issue-7654.git cd thirdweb-issue-7654 -
Install dependencies:
npm install
-
Run the app:
npm run dev
-
Reproduce the issue:
- Connect your wallet (MetaMask, Rainbow, etc.)
- Use the navigation to go to a different route (e.g.,
/about) - Reload the page
- Observe: the wallet connection is lost ❌
- ⚛️ React + Vite
- 🧭
react-router-domv7.7.0 - 🔌
@thirdweb-dev/reactv5.105.16 - 🔐 EVM Wallets tried: MetaMask, Rainbow, and Social
src/
├── App.tsx # Main routing and layout
├── main.tsx # ThirdwebProvider setup
└── components/
├── Home.tsx # Wallet connection component
└── About.tsx
- No backend — frontend-only reproduction
- No custom wallet logic or state management
- No clearing of
localStorageorsessionStorage - Minimal setup focused only on reproducing the issue
- GitHub: thirdweb-dev/js#7654
- Demo Video: View
Feel free to fork, clone, or open PRs to help investigate or fix the issue.
Author: Mustafa Siddique