I am using React Wagmi Hooks in my dapp to manage wallet connection. However, when it comes to reading or writing some contract functions it is not really practical to use the hooks. The reason I don't find it practical is that using dynamic args makes it really difficult since I have to use states to update the args. Maybe I am missing some functionality for this, if there is a good way of doing this please suggest. In conclusion, I have decided to use wagmi core functions instead of using the hooks since it is much easier to await function() with parameters taken programatically. However, if I try to use core functions with client I created with Wagmi React it gives me an error saying 'there is no client'. So do I have to replace all logic I have written using Wagmi Core, or is there a way to force it to use react wagmi client or is it possible to create two clients for each of them and use both?

  • Can you share the code that causes the error? It will be nice to have a more detailed information about the error.
    – Ismael
    Mar 13, 2023 at 4:51
  • Hi, if I make wallet connection with wagmi react hooks and If I use any function of wagmicore. For example, instead of using usePreparedWrite(), I use preapareWrite() action. It will cause an error saying there is no client because I create the client with Wagmi React library not wagmi core. And, if I create the client for wagmi core. It will still not work because if I keep the wallet connection in React library I cannot use wagmi core functions because it cannot see the connection established by the other library. Mar 13, 2023 at 12:04

2 Answers 2


I had the same problem with syncronization of two libraries. I tried to create 2 clients and it worked, but it was a bad idea because you also should dublicate chain list, providers, connect wallet, disconnect wallet, etc. After that I just updated both libs to the lates versions (0.12.1 and 0.10.1 for react and core libs respectively) and it worked with only one client

  • I don't know how to thank you. You saved me a lot of time, i tried everything, I shamed Wagmi for not making them syncoronized. Thank you!! Mar 14, 2023 at 9:37

The Wagmi React documentation has an entry for this. While Akrhip's answer is correct and you can use two clients - you can end up in bad situations (especially if you're specifiying different versions of wagmi and @wagmi/core).

The correct way of doing this is via wagmi actions.

Wagmi actually exposes all of the core functionality via the wagmi/actions export - without the need of two separate clients.

So if you want to use the prepareWrite action instead of the usePrepareWrite hook - you would need to do something like this:

import { prepareWrite } from 'wagmi/actions'
await prepareWrite();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.