You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest including the openSwitchNetworks as a prop on the ConnectKitButton.Custom render prop, to make it possible to act upon the unsupported = true scenario, the same way we can act upon isConnected = false
I've been using a pattern to prompt the user for wallet connection and switching the network (with enforceSupportedChains: false) only when they intend to do on-chain interactions.
For that I use the ConnectKitButton.Custom component. While I can handle wallet connection with it using the isConnected and show props, I can only detect wrong networks with the unsupported prop, but I need the external openSwitchNetworks callback from the useModal() hook to trigger the switching.
For reference, here's the component I use to wrap those interactions:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I suggest including the
openSwitchNetworks
as a prop on theConnectKitButton.Custom
render prop, to make it possible to act upon theunsupported = true
scenario, the same way we can act uponisConnected = false
I've been using a pattern to prompt the user for wallet connection and switching the network (with
enforceSupportedChains: false
) only when they intend to do on-chain interactions.For that I use the
ConnectKitButton.Custom
component. While I can handle wallet connection with it using theisConnected
andshow
props, I can only detect wrong networks with theunsupported
prop, but I need the externalopenSwitchNetworks
callback from theuseModal()
hook to trigger the switching.For reference, here's the component I use to wrap those interactions:
Beta Was this translation helpful? Give feedback.
All reactions