useRecycleBinItem

useRecycleBinItem(
    itemId: string,
    options?:RecycleBinItemOptions,
    deps?: any[]): IRecycleBinItemObject` | null | undefined;

Returns an item from recycle bin.

Examples

Web recycle bin item

Get item from webs recycle bin,

const item = useRecycleBinItem("3e33c760-dfd2-4107-ac4a-838b169ea3d8");

// Explicit scope type
const item = useRecycleBinItem("3e33c760-dfd2-4107-ac4a-838b169ea3d8", {
    scope: "web"
});

Get item from site collections recycle bin,

const item = useRecycleBinItem("3e33c760-dfd2-4107-ac4a-838b169ea3d8", {
    scope: "site"
});

Query recycle bin items properties,

const item = useRecycleBinItem("3e33c760-dfd2-4107-ac4a-838b169ea3d8", {
    query: {
        select: ["Title", "ItemState"],
    }
});

Parameters

NameTypeDescriptionTracked for changes
itemIdstringItem UUIDYes
options?WebAppsOptionsuseRecycleBinItem hook optionsPartially
deps?DependencyListHook dependency list.Yes