-
Notifications
You must be signed in to change notification settings - Fork 563
Open
Description
When using thirdweb v5.105.16 in a React app with react-router v7, the wallet connection (MetaMask, Rainbow, and social logins) is lost after navigating to a different route and reloading the page. This occurs despite following all recommended setup and troubleshooting steps.
To Reproduce
Steps to reproduce the behavior:
- Set up a React app with thirdweb/react v5.105.16 and react-router v7.7.0.
- Place at the root of the app, wrapping the router.
- Use directly under or inside the component consisting connect button.
- Connect a wallet (MetaMask, Rainbow, or social login).
- Navigate to a different route.
- Reload the page.
- Observe that the wallet is disconnected.
Expected behavior
The wallet connection should persist across route changes and page reloads, as per thirdweb v5 best practices.
Troubleshooting steps already performed
- wraps the entire app, including the router.
- No duplicate providers in the component tree.
- is present directly under .
- No key prop or logic causing to remount.
- No code clearing localStorage or sessionStorage.
- Observed thirdweb wallet keys in local storage after connecting; on reload, keys either disappear or wallet disconnects.
- Created a minimal app with just , , and router; issue persists.
- No relevant warnings or errors in the browser console during navigation or reload.
Additional context
- No custom state management or logic interfering with thirdweb provider.
- Issue occurs with multiple wallets and social login options.
- All recommended thirdweb v5 best practices have been followed.
Check this out: https://github.com/user-attachments/assets/646ac35f-bdf9-4e3c-a278-01bf8d835556
Metadata
Metadata
Assignees
Labels
No labels