Jonathan Guerrero
Jonathan Guerrero

Reputation: 371

Can I use react-select in react-native?

I'm trying to implement a search form, in my react-native app. For it, I need something like react-select or select-2, both tools are made for web systems and I don't know if is a good idea to use it for a react-native app.

I already tried to install and use it in react-native but this does not appear to work.

Upvotes: 9

Views: 12607

Answers (2)

DevTheJo
DevTheJo

Reputation: 2497

You can't use select2 or react-select with react-native, because it's DOM based and so, it will work only in navigator, not in react-native

The closest react-native equivalent I've found is react-native-multiple-select, you can find it on github at https://github.com/toystars/react-native-multiple-select or install it with

npm i react-native-multiple-select

Upvotes: 4

Highlight
Highlight

Reputation: 124

Probably the closest to what you want that comes bundled with React Native is http://facebook.github.io/react-native/docs/picker.html

The Picker component will give you a tumbler thing on iOS and a dropdown on Android

Alternatively maybe this 3rd party component is closer to what you want: https://github.com/bulenttastan/react-native-list-popover

From How to use React native select box

Upvotes: 3

Related Questions