useFiles

useFiles(
	folderId: string,
	options?: FilesOptions,
	deps?: any[]): IFileInfo[] | null | undefined;

Returns file collection from folder.

Examples

Get all files from a folder by UUID,

const files = useFiles("5ee53613-bc0f-4b2a-9904-b21afd8431a7");

Get all files from a folder by server relative URL,

const siteAssetsFiles = useFiles("/sites/mysite/SiteAssets", {
	query: {
		select: ["Id", "Name", "ServerRelativeUrl", "Author/Title"]
		expand: ["Author"]
	}
});

Parameters

NameTypeDescriptionTracked for changes
folderIdstringFolder UUID or server relative URLYes
options?FilesOptionsuseFiles hook optionsPartially
deps?DependencyListHook dependency list.Yes