useGroup

useGroup(
	groupId: string | number,
	options?: GroupOptions,
	deps?: any[]): ISiteGroupInfo | null | undefined;

Returns a group from group collection.

Examples

Get group info by Id,

const group = useGroup(10);

Get group info by name

const mySpGroup = useGroup("My SharePoint Group");

Query group properties,

const mySpGroup = useGroup("My SharePoint Group", {
	query: {
		select: ["Title", "Id"]
	}
});

Parameters

NameTypeDescriptionTracked for changes
groupIdstring | numberGroup Id or nameYes
options?GroupOptionsuseApps hook optionsPartially
deps?DependencyListHook dependency list.Yes