UNPKG

@foreverrbum/ethsign

Version:

This package will allow you to electronically sign documents within your application

13 lines (10 loc) 346 B
import React, { useEffect, useState } from 'react'; export const useActiveChain = (provider) => { const [activeChain, handleActiveChain] = useState(null); useEffect(()=> { (async () => { handleActiveChain(await provider.getNetwork()); })(); }, [provider]); return [activeChain, handleActiveChain]; }