multiple chain signer #1929
Unanswered
emimaricic
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys, I'm using 2 smart contracts on different networks and I wonder how can I change useSigner data depending on chain.id change, everything I do breaks my app and I don't find a way to do that
`
const provider = useProvider();
const {
data: signer,
isLoading,
isError,
} = useSigner({ chainId: chain?.id === 80001 ? 80001 : 97 });
useEffect(() => {
if (isLoading) return;
if (address && signer && !isLoading) {
if (contract) {
setContract(null);
clearRaffles();
clearIsChecked();
}
}, [address, signer]);
`
Beta Was this translation helpful? Give feedback.
All reactions