---
url: "https://vueda.dev/v3/reference/api/js/use/useViewDestroy/functions/useViewDestroy.md"
title: "useViewDestroy"
---

# useViewDestroy

## Overview

Provides instance deletion support for a view screen.

Internally loads the instance(s) matching the provided `pk`, then exposes a
`handleDelete` function that can perform bulk deletion and report errors.

## Signature

`useViewDestroy(props)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-props">props</span> | `object` | yes | The reactive props object. |

#### props Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-props-app">app</span> | `string` |  |  |  |
| <span id="param-props-model">model</span> | `string` |  |  |  |
| <span id="param-props-pk">pk</span> | `string \| string[]` |  |  |  |

### Returns

[ViewDestroyState](/v3/reference/api/js/use/useViewDestroy/types/ViewDestroyState.md)

An object containing reactive state and the `handleDelete` function.

## Source

`client/lib/use/useViewDestroy.js:39`
