DeleteAction

Declarative component wrapper for delete actions

Provides a render-prop pattern for triggering delete actions with automatic dependency checking and confirmation dialogs.

Installation

import { DeleteAction } from 'uxp/components';

Signature

const DeleteAction: React.FunctionComponent<DeleteActionProps>

Examples

Basic usage with button
```tsx
<DeleteAction
  model="Location.Location"
  objectKey={locationKey}
  canHide={true}
  onSuccess={(action) => {
    if (action === 'delete') {
      navigate('/locations');
    }
  }}
>
  {(handleDelete) => (
    <Button onClick={handleDelete}>Delete Location</Button>
  )}
</DeleteAction>

Properties

Name
Type
Mandatory
Default Value
Example Value

model

string

Yes

-

-

objectKey

string | number

Yes

-

-

children

(deleteHandler: () => Promise) => React.ReactNode

Yes

-

-

Last updated