useFolder

useFolder(
	folderId: string,
	options?: FolderOptions,
	deps?: any[]): IFolderInfo | null | undefined;

Return a folder.

Examples

Get folder by Id,

const folder = useFolder("5ee53613-bc0f-4b2a-9904-b21afd8431a7");

Get folder by server relative url,

const siteAssets = useFolder("/sites/mysite/SiteAssets", {
	query: {
		select: ["Id", "Name", "ServerRelativeUrl"]
	}
});

Parameters

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