Skip to content

useRune

Gets a rune by its ID. See getRune for more information.

Import

ts
import { useRune } from "@midl/react";

Example

tsx
function Rune() {
  const { rune, isLoading, error } = useRune({
    runeId: "1:1",
  });

  if (isLoading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;

  return <div>Rune: {rune?.name}</div>;
}

Parameters

NameTypeDescription
runeIdstringThe ID of the rune to fetch.
queryUseQueryOptions(optional) Query options for react-query.
configConfig(optional) Custom config to override the default from context.

Returns

NameTypeDescription
runeGetRuneResponseThe fetched rune data.
...restobjectAdditional query state (e.g. isLoading, error, etc.).