-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Describe the bug
Unable to switch chain ID using wagmi's useSwitchNetwork
Steps
- Set up config like in the wagmi connector docs example with base and baseSepolia chains*
- Connect wallet as shown in the docs example
- Call
switchChainto baseSepolia.id (assuming we are connected to base mainnet) - Log
chainIdin the console usinguseChainIdhook to confirm chain ID has not switched.
I've created a reproducible example here: https://github.com/mrosendin/smart-wallet-expo-switchChain
*I've installed client v0.1.1 and wagmi-connectors v1.0.0 and appChainIds property in the metadata object for createConnectorFromWallet is not recognized, so I removed it. Here's the error message:
Object literal may only specify known properties, and 'appChains' does not exist in type 'StrictOmit<AppMetadata, "appChainIds">'.
This error msg is at odds with the docs example.
Expected behavior
Connector switches chain and useChainId returns the updated chain ID.
The chain ID will switch only after a hard refresh in Expo Go
Version
client v0.1.1, wagmi-connectors v1.0.0
Additional info
No response
Desktop
No response
Smartphone
- Device: iPhone 13
- OS: iOS 17.6.1
Metadata
Metadata
Assignees
Labels
No labels