Skip to content

useHeight

Hook for fetching the current block height of the Aeternity network.

Import

typescript
import { useHeight } from '@growae/reactive-react'

Usage

tsx
import { useHeight } from '@growae/reactive-react'

function BlockHeight() {
  const { data: height, isLoading } = useHeight()

  if (isLoading) return <div>Loading...</div>
  return <div>Current height: {height}</div>
}

Return Type

See TanStack Query query docs for full return type.

data

  • Type: number

The current key block height.

Parameters

networkId

  • Type: string
  • Optional

Target network.

query

See TanStack Query query docs for query options.