use-midnight
v0.1.0
Published
A React hook to use Midnight in the browser
Downloads
92
Maintainers
Readme
use-midnight
A React hook to use Midnight in the browser
Install
npm install use-midnight
Usage
import React from "react";
import { useMidnight, MidnightButton } from "use-midnight";
import type { MidnightAPI } from "use-midnight";
function App() {
const subscribe = (mn: MidnightAPI) => {
console.log(md);
};
return <MidnightButton subscribe={subscribe} />;
}
The hook has 2 exports:
1- a useMidnight
function that performs different checks and returns values injected by the Lace wallet into the browser
2- a MidnightButton
with a customizable appearance that shows the status of the dapp and user connection to the Lace wallet
License
MIT © claudebarde