-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reinitialize Providers #96
Comments
Currently no, initialization only runs once when the app mounts. Your app supports switching networks on the fly? I usually think of different networks as being different environments, each with its own URL. Not saying one way or the other is better, just explaining the thinking behind the initialize-once approach. I could see this being a feature added in a future release. |
@drichar Per our chat about the "useNetwork" hook I created for https://github.com/SilentRhetoric/solid-algo-wallets, there are use cases for some dapps/tools in which a user may want to switch networks on the fly. Having a reactive way to change out the algodClient can enable the app to (mostly) seamlessly pivot to another network. Of course, the user needs to have their wallet on the right network, and not all wallets work on all networks, so there are some possible UX snags. On balance, though, if a dapp wants to give the user the ability to switch networks, most wallets can cope with this and the library could offer it (perhaps optionally). |
💯 This is where my mind went with |
This will be possible in use-wallet v3, currently in development here: https://github.com/TxnLab/use-wallet-js I'll keep this issue open for further discussion until the v3 full release. |
the is a way to reinitialize the providers? without recompiling the project for switching networks on the fly like testnet mainet, I was trying to do it but I guess "useInitializeProviders" don't support this behavior thanks!
The text was updated successfully, but these errors were encountered: