rainbow-me / rainbowkit

The best way to connect a wallet 🌈 🧰

Home Page:https://rainbowkit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Once the wallet is connected, it will be disconnected immediately.

lucian55 opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

RainbowKit Version

2.0.4

wagmi Version

^2.5.5

Current Behavior

Once the wallet is connected, it will be disconnected immediately.

Expected Behavior

import { RainbowKitProvider, darkTheme, getDefaultConfig } from "@rainbow-me/rainbowkit";
import "@rainbow-me/rainbowkit/styles.css";
import {
  bitgetWallet,
  coinbaseWallet,
  ledgerWallet,
  metaMaskWallet,
  okxWallet,
  phantomWallet,
  rainbowWallet,
  tokenPocketWallet,
  trustWallet,
  walletConnectWallet,
  zerionWallet,
} from "@rainbow-me/rainbowkit/wallets";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { blast, mainnet } from "wagmi/chains";


const RainbowkitProvider = ({ children }: any) => {
  const projectId = "xxxxxx";



  const AppInfo = {
    appName: "xxx",
    projectId,
  };

  const config = getDefaultConfig({
    ...AppInfo,
    chains: [mainnet, blast],

    ssr: true,
    wallets: [
      {
        groupName: "Popular",
        wallets: [
          metaMaskWallet,
          tokenPocketWallet,
          bitgetWallet,
          okxWallet,
          zerionWallet,
          // binanceWallet,
          phantomWallet,
          walletConnectWallet,
          trustWallet,
          rainbowWallet,
          ledgerWallet,
          coinbaseWallet,
        ],
      },
    ],
  });
  const queryClient = new QueryClient();

  return (
    <WagmiProvider config={config} reconnectOnMount={false}>
      <QueryClientProvider client={queryClient}>
        <RainbowKitProvider
 
          appInfo={AppInfo}
          locale="en-US"
        >
          {children}
        </RainbowKitProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
};

export default RainbowkitProvider;

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

commented

@lucian55 Can't seems to reproduce this. Did you mean that it doesn't connect during on mount ? If that's the case then remove reconnectOnMount prop from <WagmiProvider>.

reproduce_issue_1929.mov
commented

@lucian55 Any updates ?

I'm not sure why, but it's fine now. Thanks