Skip to content

@pgege/kaboo-react


Function: useDrill()

useDrill(): DrillState

Defined in: hooks/useDrill.ts:21

Reads the drill-down navigation state (DrillState) from the nearest DrillProvider: the current path plus drillIn/drillUp/drillToRoot/ drillToLevel.

Returns

DrillState

Example

import { useDrill } from "@pgege/kaboo-react";

function BackButton() {
  const { drillUp, activeDrill } = useDrill();
  if (!activeDrill) return null;
  return <button onClick={drillUp}>Back</button>;
}