Skip to content

useAcmeClient

Access the shared Acme client from Preact components.

useAcmeClient#

useAcmeClient(): Client

Returns the client from the nearest AcmeProvider. Throws if used outside a provider.

Example#

import { useAcmeClient } from "@acme/client/preact";

function UserCount() {
  const client = useAcmeClient();
  // ...
}

See also#