@nance/nance-hooks
v4.1.5
Published
hooks for https://nance.app
Downloads
57
Readme
Install
yarn add @nance/nance-hooks
Usage
Wrap components with NanceContext.Provider
and pass apiUrl
as a prop. And then you can use nance hooks.
Check full example here.
import { NanceProvider, useSpaceInfo } from "@nance/nance-hooks";
const apiUrl = "https://api.nance.app";
export default function SpacePage() {
return (
<NanceProvider apiUrl={apiUrl}>
<SpaceInfoCard />
</NanceProvider>
)
}
function SpaceInfoCard() {
const { spaceInfo } = useSpaceInfo();
return (
<div>
<h1>{spaceInfo.name}</h1>
<p>{spaceInfo.description}</p>
</div>
)
}