UNPKG

@web3auth/no-modal

Version:
14 lines (11 loc) 460 B
import { useContext } from 'react'; import { Web3AuthInnerContext } from '../context/Web3AuthInnerContext.js'; import { WalletInitializationError } from '../../base/errors/index.js'; const useWeb3AuthInner = () => { const context = useContext(Web3AuthInnerContext); if (!context) { throw WalletInitializationError.fromCode(1000, "usage of useWeb3Auth not wrapped in `Web3AuthContextProvider`."); } return context; }; export { useWeb3AuthInner };