Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use React native select box

Tags:

react-native

I was working on an IosApp using React Native. I need a form element like select box in HTML. Is there any ways to achieve the same in React Native Form components?

like image 383
Ashik Avatar asked May 09 '15 07:05

Ashik


People also ask

How do you use the select box in react-native?

To work with react-native-picker-select , we must import the RNPickerSelect component: import RNPickerSelect from "react-native-picker-select"; This component is then reused in our code to render the select view.

How do you get the selected value of picker in react-native?

if you are using react-redux you can map the value where selected item is stored using mapStateToProps (here is the documentation) and if you are directly using redux you can still do it. then once the action of choosing other has dispatched and the value is set your input will show. Save this answer.

How do I add a check box in react-native?

Add the CheckboxWindows project to your solutionRight-click solution icon in Solution Explorer > Add > Existing Project. Select 'D:\pathToYourApp\node_modules@react-native-community\checkbox\windows\CheckboxWindows\CheckboxWindows.


1 Answers

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

People are creating new components for React Native all the time, a good place to search from them is: https://react.parts/

like image 175
Thomas Parslow Avatar answered Oct 21 '22 19:10

Thomas Parslow