-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[feature] New @reown vue package don't support vue Refs. #2874
Comments
Ok I think I got vue reactivity working using Install Initialize reown appkit vue in a // config.js
import { createAppKit } from '@reown/appkit/vue'
import { base } from '@reown/appkit/networks'
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
// 1. Get projectId from https://cloud.reown.com
export const projectId = 'YOUR_ID'
// 2. Create a metadata object - optional
const metadata = {
// ...
}
const networks = [base]
// 3. Create Wagmi Adapter
const wagmiAdapter = new WagmiAdapter({
ssr: true,
projectId,
networks,
})
// export wagmiConfig for use around the app
export const wagmiConfig = wagmiAdapter.wagmiConfig
// 4. Create modal
createAppKit({
adapters: [wagmiAdapter],
networks,
metadata,
projectId,
features: {
analytics: true // Optional - defaults to your Cloud configuration
}
}) Import in your // main.js
import { createApp } from 'vue'
import App from './App.vue'
import './config'
import { WagmiPlugin } from '@wagmi/vue'
import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'
import { wagmiConfig } from './config'
const app = createApp(App)
const queryClient = new QueryClient()
app.use(WagmiPlugin, { config: wagmiConfig })
app.use(VueQueryPlugin, { queryClient })
app.mount('#app') Then you can use import { useAccount } from '@wagmi/vue`
const { address, isConnected } = useAccount() So maybe vue reactivity isn't actually necessary in the appkit library? |
already solved the import react library -> @tanstack/vue-query |
Now, we are multichain. So it's depends in what your are doing on your dApp. But if you are using only eth chains, it would be ok. |
@evvvritt do you have a minimal workable repository with your proposal to see ? Would you mind sharing it with me ? |
@rtomas I have it integrated in a private project's repo but not a public minimal version. I would just do what I did above – or is that configuration not running? |
@ultraKelevra Yes sir, I also check this a major issue |
It would be great if you can give me feedback from this example : https://github.com/reown-com/web-examples/tree/feat/create-vue-wagmi-example/dapps/appkit/vue-wagmi (also vue-solana example in other directory) Also make a PR for docs -> reown-com/reown-docs#136 Any feedback is welcome. |
What problem does this new feature solve?
The problem this feature solves is clearer code and easier time. In short, a better UX for the developer (in my opinon)
Not having access to the reactive properties is pretty lame. Please bring them back.
I like to use reactive properties. I think they are VERY useful, and the current version (@Reown) no longer supports them. This seems odd for a library that has Vue integration. (At the beginning I thought it was a bug)
Describe the solution you'd like
I really liked how you could call "useWallet()" or "useAccount()" and the object's fields it returned were "Refs" most of the time. Meaning that every field that was a "Ref", was reactive. You could feed it into any Vue component, or pass it along through a chain of properties from parent to child nodes all the way to whatever component needed information from the wallet. Or combine into computed properties which themselves were also reactive.
For instance, you could call:
I used to do this for conditional menus, tags, progress indicators, etc. Now I can't. And to be honest, I feel a bit lost with the new way stuff is being implemented to return the resulting value instead of a reactive field. I'm supposed to listen events all the time / call "useWallet()" on every function that has to check the connection state or the user address?
I know that the new approach seems to be precisely that... But I feel like this is a downgrade. I would like to at least have some option to enable reactive properties back.
The text was updated successfully, but these errors were encountered: