# Migrate from react-native-element-dropdown

> Switch from react-native-element-dropdown to Patine UI: Dropdown and MultiSelect become one Select, with search, chips, groups and server search, in iOS, Material and web designs.

# Migrate from `react-native-element-dropdown`

`Dropdown` and `MultiSelect` are one component, `Select`, with `multiple` for the second. Options always have `label` and `value`, so `labelField` and `valueField` go away, and `onValueChange` gets the value with the option next to it.

```diff
- import { Dropdown } from 'react-native-element-dropdown';
+ import { Select } from 'patine-ui';

- <Dropdown
-   data={fruits}
-   labelField="label"
-   valueField="value"
-   placeholder="Select a fruit"
-   search
-   searchPlaceholder="Search..."
-   value={value}
-   onChange={(item) => setValue(item.value)}
- />
+ <Select
+   options={fruits}
+   placeholder="Select a fruit"
+   searchable
+   searchPlaceholder="Search..."
+   value={value}
+   onValueChange={setValue}
+ />
```

| react-native-element-dropdown | Patine UI |
| --- | --- |
| `Dropdown` / `MultiSelect` | `Select` / `Select multiple` |
| `data` + `labelField` + `valueField` | `options`, mapped to `{ label, value }` once: `data.map((d) => ({ label: d.name, value: d.id }))` |
| `value` | `value` (an array with `multiple`) |
| `onChange(item)` | `onValueChange(value, option)` |
| `placeholder` | `placeholder` |
| `search` | `searchable` (on by default past 8 options) |
| `searchPlaceholder` | `searchPlaceholder` |
| `searchQuery` | `filterOption(option, query)`; `keywords` on an option are searched too |
| `maxSelect` | `maxSelected` |
| `disable` | `disabled` |
| `mode="modal"` | `presentation="modal"` |
| `renderItem(item, selected)` | `renderOption({ option, selected, disabled, theme })` |
| `renderLeftIcon` | `icon` on each option, shown in the field for the selected one |
| `renderSelectedItem` | chips by default; `renderTrigger` for your own field |
| `maxHeight` | `listHeight` |

See [Select](../../components/select) for groups, icons and server search.

See [all migration guides](./index.mdx) for other libraries, and [Comparison](../comparison.mdx) for when another library is the better choice.
