useViews

useViews(
	listId: string,
	options?: ViewsOptions,
	deps?: any[]): IViewInfo[] | null | undefined;

Returns list view collection.

Examples

Get list views,

const allViews = useViews("9db07c1f-7880-4601-99d0-1c39c43f6599");

Query list views,

const viewTitles = useView("My List", {
	query: {
		select: ["Title"],
		top: 5
	}
});

Parameters

NameTypeDescriptionTracked for changes
listIdstringList UUID or titleYes
options?ViewsOptionsuseViews hook optionsPartially
deps?DependencyListHook dependency list.Yes