0.0.24 • Published 3 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
3 years ago
0.0.21
3 years ago
0.0.22
3 years ago
0.0.23
3 years ago
0.0.24
3 years ago
0.0.13
3 years ago
0.0.14
3 years ago
0.0.15
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.18
3 years ago
0.0.19
3 years ago
0.0.12
3 years ago
0.0.11
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.5-alpha.0
3 years ago