//useCallback to remove too much re-render
const checkFromLocalStorage = useCallback(() => {
if (localStorage.getItem('connectedWallet')) {
//check connectWallet with switch
switch (localStorage.getItem('connectedWallet')) {
case 'walletConnect':
activate(WalletConnect);
case 'metamask':
activate(Injected);
default:
}
}
}, [active]);
useEffect(() => {
checkFromLocalStorage();
}, [active]);