const { walletProvider } = useAppKitProvider() ' walletProvider is undefined #3146
Unanswered
harissatti
asked this question in
Q&A
Replies: 1 comment 1 reply
-
any dev know about this error? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
import React, { useState, useEffect } from 'react';
import './App.css';
import axios from 'axios';
import { createAppKit } from '@reown/appkit/react'
import { EthersAdapter } from '@reown/appkit-adapter-ethers'
import { bscTestnet } from '@reown/appkit/networks';
import { ethers, formatEther, BrowserProvider } from 'ethers';
import { useAppKitProvider, useAppKitAccount } from '@reown/appkit/react';
import { useDisconnect } from '@reown/appkit/react';
import { ToastContainer, toast } from 'react-toastify';
// Project ID and Blockchain Configuration
const projectId = '46d0d43d306ef77a317edfdf202573';
const networks = [bscTestnet];
const metadata = {
name: 'localhost',
description: 'My Website description',
url: 'https://mywebsite.com', // origin must match your domain & subdomain
icons: ['https://avatars.mywebsite.com/']
}
// Initialize AppKit modal outside the component
const modal = createAppKit({
adapters: [new EthersAdapter()],
networks,
metadata,
projectId,
features: {
analytics: true // Optional - defaults to your Cloud configuration
}
});
console.log(new EthersAdapter(),"ds");
const App = () => {
const [amount, setAmount] = useState('');
const [bnbBalance, setBnbBalance] = useState('');
const [points, setPoints] = useState(0);
const [isLoading, setIsLoading] = useState(false);
const { address, chainId, isConnected } = useAppKitAccount();
const { disconnect } = useDisconnect();
const { walletProvider } = useAppKitProvider()
"""how can we solve this issue ?"""
Beta Was this translation helpful? Give feedback.
All reactions