7.6.2.62. useDeleteModal
A hook that provides a callback to launch a modal for deleting a resource.
Example
const DeletePodButton = ({ pod }) => {
const { t } = useTranslation();
const launchDeleteModal = useDeleteModal<PodKind>(pod);
return <button onClick={launchDeleteModal}>{t('Delete Pod')}</button>
}
| Parameter Name | Description |
|---|---|
|
| The resource to delete. |
|
| (optional) A location to redirect to after deleting the resource. |
|
| (optional) A message to display in the modal. |
|
| (optional) The text to display on the delete button. |
|
| (optional) A function to delete all resources of the same kind. |
Returns A function which launches a modal for deleting a resource.