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

1.1.1 • Public • Published

@subql/react-hooks

Description

React Hooks Client, which exports various useful hooks.

This package will generate React useQuery hooks by using the queries and types from the @subql/network-query package.

Usage

  • To see generated hooks run yarn codegen-gql or yarn build from root of monorepo.

  • If you need a useQuery hook that isn't avaliable in src/__hooks__ follow instructions in @subql/network-query README.md to add queries which this package can use to generate hooks.

Example

  • Note: full examples on how to use all hooks are included in the generated files under src/__hooks__ directory.
    import { useGetDeploymentIndexersQuery } from '@subql/react-hooks';
    const { data, loading, error } = useGetDeploymentIndexersQuery({
        variables: {
        offset: // value for 'offset '
        deploymentId: // value for 'deploymentId'
        },
    });

ChangeLogs

CHANGELOG.md

Readme

Keywords

none

Package Sidebar

Install

npm i @subql/react-hooks

Weekly Downloads

65

Version

1.1.1

License

Apache-2.0

Unpacked Size

728 kB

Total Files

121

Last publish

Collaborators

  • onfinality-admin
  • jay_ji