UNPKG

@lifi/widget

Version:

LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.

14 lines (13 loc) 369 B
import { useMemo } from 'react'; import { useChains } from './useChains'; export const useChain = (chainId) => { const { chains, isLoading } = useChains(); const chain = useMemo(() => { const chain = chains?.find((chain) => chain.id === chainId); return chain; }, [chainId, chains]); return { chain, isLoading, }; };