Skip to content

useFiles

useFiles(options): UseFilesResult

Defined in: libs/ccs-files-user-client/src/react/hooks.ts:49

The FilesClient for the lifetime of the component.

  • Options (apiUrl, tenantId, applicationId, getAccessToken): built at once; getAccessToken is read through a ref, so it needs no stable identity; only a change of apiUrl, tenantId or applicationId builds a new client.
  • { tokens, overrides? }: built with FilesClient.fromTokenRoute (the route’s api_url, tenant_id, application_id); client is null until then.
  • { client }: your own client, used as is and never disposed by the hook.

A client the hook built is disposed when it is replaced or the component unmounts.

UseFilesOptions

UseFilesResult