Back to React Admin

The DeletedRecordsListMenuItem Component

docs/DeletedRecordsListMenuItem.md

5.14.61.1 KB
Original Source

<DeletedRecordsListMenuItem>

The <DeletedRecordsListMenuItem> component displays a menu item for the deleted records list.

tsx
// in src/MyMenu.tsx
import { Menu } from 'react-admin';
import { DeletedRecordsListMenuItem } from '@react-admin/ra-soft-delete';

export const MyMenu = () => (
    <Menu>
        <DeletedRecordsListMenuItem />
        ...
    </Menu>
);

Clicking on the deleted records list menu item leads to the /deleted route by default. You can customize it using the to property:

tsx
// in src/MyMenu.tsx
import { Menu } from 'react-admin';
import { DeletedRecordsListMenuItem } from '@react-admin/ra-soft-delete';

export const MyMenu = () => (
    <Menu>
        <DeletedRecordsListMenuItem to="/trash" />
        ...
    </Menu>
);

<DeletedRecordsListMenuItem> inherits all properties from <Menu.Item> component. This means that you can customize this menu item label by using the primaryText or children properties.