Hooks for reading schemas, running actions and driving UI state. Use them when you build a custom
component that has to behave like the generated ones — inside the generated views the same data is
already in context.
Data and actions
| Hook | What it gives you |
|---|
| useGetLocalResourceSchema | A resource's full schema plus flags for the views, actions and endpoints it exposes |
useSchemaProvider | The schema provider in context; a type argument adds an extension package's methods as optional — see SchemaProvider |
| useGetAll | Every record of a resource, paginated behind the scenes |
| useCallAction | Runs a backend action, including polling for background tasks |
| useAggregate | An aggregation over a resource, and the schema saying what may be aggregated — ships in habarico-enterprise |
| useUploadQueue | The upload queue behind UploadInput — base64 and chunked |
| useSubmitForm | Submit handling for a hand-built form: notifications, field errors, loading state |
| useRemoveArrayItem | Row removal for a hand-built array editor, without the deleted row's values leaking onto its neighbour |
Schemas and context
| Hook | What it gives you |
|---|
| Schema lookup hooks | useGetGlobalResourceSchema, useGlobalResourceSchemaContext, useGetServiceSchemas, useLocalResourceSchemaRefresh |
| Context hooks | useSchemaRootContext, useAdminConfig, useIcons, useViewSchemaContext, useFieldSchemaContext, useRootRecordContext, useFormInputSourcesContext, useFormInputSourcesRegistration, useUnsavedChanges, useUnsavedChangesControl, useGetTargetValues |
| useSchemaValidators | The validators for a field's schema rules, for an input you wrote yourself |
UI state
| Hook | What it gives you |
|---|
| useTabsLocation | Active tab state kept in the URL hash |
| useRowClick | Single- and double-click activation for datagrid rows |
| useRecordLink | Opens a record as a page, a dialog or a docked panel — the link behind every record chip |
| useExporter | Runs a backend export and downloads the returned file |
| useStrTemplate | Interpolates %{record.field} templates from the current record or form |
| Dashboard hooks | useDashboardStore and useGetWidget, both from habarico-enterprise |
Thin wrappers
useRouter and usePathname wrap react-router with no Habarico behaviour of their own —
useRouter returns {back, forward, refresh, push, replace} and usePathname returns the current
path. Use them for consistency with the library's own components, or use react-router directly;
there is no difference.
See also