React
- Introduction to the SDK
- Configuration
- Upgrade Guides
- SDK/User Loading States
- Providers and Connectors
- UI Components
- Hooks
- Events
- Handlers
- Objects
- Utilities
- Examples
Programmatically switch network
More info on the network switching page.
Copy
Ask AI
const { walletConnector } = useDynamicContext();
if (walletConnector.supportsNetworkSwitching()) {
await walletConnector.switchNetwork({ networkChainId: 137 });
console.log("Success! Network switched");
}
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.