1

export default function Walletconnect() {
  const connector = useWalletConnect();
  
  const connectWallet = React.useCallback(() => {
    try{
       console.log("wallet");
        console.log("return",connector.connect());
        return connector.connect();
    }catch(err){
    console.log(err)
    }
     
      }, [connector]);

  const killSession = React.useCallback(() => {
    return connector.killSession();
  }, [connector]);


  
  return (
    <>
      {!connector.connected ? (
        <Button onPress={connectWallet} label="Connect a wallet" />
      ) : (
        <>
          <Text>{shortenAddress(connector.accounts[0])}</Text>
          <Button onPress={killSession} label="Log out" />
        </>
      )}
    </>
  );
}

When clicking a button(connect a wallet) then not open metamask wallet. connector.connect() not response any.

Check console data in screenshoot

TylerH
  • 20,799
  • 66
  • 75
  • 101
Hashmi
  • 21
  • 3

0 Answers0