# Migrate from react-native-popup-menu

> Switch from react-native-popup-menu to Patine UI: one DropdownMenu with an actions array instead of MenuTrigger, MenuOptions and MenuOption, no MenuProvider, iOS, Material and web designs, and a sheet presentation.

# Migrate from `react-native-popup-menu`

[`DropdownMenu`](../../components/dropdown-menu) takes the options as one `actions` array, and its `children` is the trigger. There's no `MenuProvider` to wrap the app in.

```diff
- import { Menu, MenuOption, MenuOptions, MenuProvider, MenuTrigger } from 'react-native-popup-menu';
+ import { DropdownMenu } from 'patine-ui';

- <Menu onSelect={(value) => (value === 'save' ? save() : remove())}>
-   <MenuTrigger text="Options" />
-   <MenuOptions>
-     <MenuOption value="save" text="Save" />
-     <MenuOption value="delete">
-       <Text style={{ color: 'red' }}>Delete</Text>
-     </MenuOption>
-   </MenuOptions>
- </Menu>
+ <DropdownMenu
+   actions={[
+     { label: 'Save', onPress: save },
+     { label: 'Delete', destructive: true, onPress: remove },
+   ]}
+ >
+   <Text>Options</Text>
+ </DropdownMenu>
```

Remove `<MenuProvider>` from your app root.

| react-native-popup-menu | Patine UI |
| --- | --- |
| `MenuTrigger` / `text` | the trigger as `children` |
| `MenuTrigger triggerOnLongPress` | `openOnLongPress` |
| `MenuOption text` | `label` |
| `MenuOption onSelect` / `Menu onSelect(value)` | `onPress` on each action |
| `MenuOption disabled` | `disabled` |
| a red `MenuOption` child | `destructive: true` |
| custom `MenuOption` children | `icon` and `description`, or `styles` |
| `renderer={renderers.SlideInMenu}` | `presentation="sheet"` |
| `renderer={renderers.Popover}` / `rendererProps` | — |
| `opened` (controlled) | — |
| `onOpen` / `onClose` | `onOpenChange(open)` |
| `customStyles` | `styles={{ trigger, menu, action, actionLabel }}` |

See [all migration guides](./index.mdx) for other libraries.
