@glow-xyz/glow-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@glow-xyz/glow-react

The @glow-xyz/glow-react gives you a React interface to hook up Glow with your dApp.

Installing

# npm
npm install @glow-xyz/glow-react

# yarn
yarn add @glow-xyz/glow-react

# pnpm
pnpm install @glow-xyz/glow-react

Usage

// Top level app component
import { GlowSignInButton, GlowProvider } from "@glow-xyz/glow-react";
import "@glow-xyz/glow-react/dist/styles.css";

const App = ({children}) => {
  return (
    <GlowProvider>
      {children}
    </GlowProvider>
  )
}

// Component rendered under <App /> in the tree
const Home = () => {
  const { user } = useGlowContext();

  return (
    <div>
      {user ? (
        <div>Signed in as {user.address}</div>
      ) : (
        <GlowSignInButton />
      )}
    </div>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @glow-xyz/glow-react

Weekly Downloads

896

Version

1.0.2

License

none

Unpacked Size

72.2 kB

Total Files

27

Last publish

Collaborators

  • sjchmiela
  • vpontis