useFolders

useFolders(
	options?: FoldersOptions, 
	deps?: any[]): IFolderInfo[] | null | undefined;

Returns folders from root. Use FoldersOptions.rootFolderId property to change root folder.

Examples

Get folders from webs root,

const rootFolders = useFolders();

Get folders from different folder,

const folders = useFolders({
	rootFolderId: "5ee53613-bc0f-4b2a-9904-b21afd8431a7"
});

const folders = useFolders({
	rootFolderId: "/sites/mysite/SiteAssets"
});

Query folders,

const filteredFolders = useFolders({
	query:{
		select: ["Id", "Title"],
		filter: "substringof('SiteAssets', Title) eq true"
	}
});

Parameters

NameTypeDescriptionTracked for changes
options?FoldersOptionsuseFolders hook optionsPartially
deps?DependencyListHook dependency list.Yes