@comms-id/apra-registered-financial-corporation-lookup-react
A React hook and a finished component for the APRA list field: the user types a corporation name or an ABN. Accessible, no layout shift, with the data attribution always shown. React 18 or later; it depends on @comms-id/apra-registered-financial-corporation-lookup and nothing else.
import { createApraRegisteredFinancialCorporationLookupBrowserClient } from "@comms-id/apra-registered-financial-corporation-lookup/browser";
import { ApraRegisteredFinancialCorporationLookupLookup } from "@comms-id/apra-registered-financial-corporation-lookup-react";
const client = createApraRegisteredFinancialCorporationLookupBrowserClient({ relayUrl: "/api/comms-id/apra-registered-financial-corporation-lookup" });
export const Form = () => <ApraRegisteredFinancialCorporationLookupLookup client={client} onSelect={(record) => console.log(record)} />;
relayUrl is your own server route, set up with @comms-id/relay: your server signs the call as your registered app, so the browser holds no credential.
What the field does
- A name: after the user pauses, it suggests corporations (name, ABN, category or exempted) from APRA's published list of registered financial corporations. The search already returns each whole record, so choosing one needs no second call. Rows that APRA publishes without an ABN are found this way only.
- An ABN: eleven digits (spaces allowed) are checked in the browser and looked up at once. A wrong length or checksum is refused and nothing is sent.
- An exempted corporation is shown as "Exempted from registration", never as registered (FSCODA s7(2)(j)).
- "Not on APRA's published list of registered financial corporations." and "Financial corporation lookup is unavailable" are different messages. Not on the page is not proof that a corporation is unregistered: APRA's legal list is the one it publishes in the Gazette (s11(4)).