0.0.24 • Published 4 years ago
@qhecuba/hector-react-hooks v0.0.24
hector-react-hooks
Hector React hooks
This package also installs hector-metamask and hector packages.
Install
Npm:
npm install @qhecuba/hector-react-hooks
Yarn:
yarn add @qhecuba/hector-react-hooks
Usage
const [status, connect, getWallet] = useConnect(wallets.metamask());Example
import React from "react";
import { useConnect, wallets } from "@qhecuba/hector-react-hooks";
import { useEffect } from "react";
function App() {
const [status, connect, getWallet] = useConnect(wallets.metamask());
useEffect(() => {
connect();
getWallet();
}, []);
return (
<div className="App">
<h1>{status.isConnected ? "Connected" : "Not connected"}</h1>
<p>Wallet: {status.wallet}</p>
<button onClick={connect}>Connect</button>
</div>
);
}
export default App;0.0.20
4 years ago
0.0.21
4 years ago
0.0.22
4 years ago
0.0.23
4 years ago
0.0.24
4 years ago
0.0.13
4 years ago
0.0.14
4 years ago
0.0.15
4 years ago
0.0.16
4 years ago
0.0.17
4 years ago
0.0.18
4 years ago
0.0.19
4 years ago
0.0.12
4 years ago
0.0.11
4 years ago
0.0.10
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.5-alpha.0
4 years ago