What am I doing wrong with my React Native PickerSelect? It crashed all the time without a warning.
import RNPickerSelect from 'react-native-picker-select'; getCompanies = () => { var items = this.state.companies.map(obj => ({ key: obj.id, label: obj.name, value: obj.id, })); return items; };
This is rendered:
<RNPickerSelect onValueChange={value => this.setState({company: value}) } items={this.getCompanies()} />
But when I open the view where this should be rendered, my App crashes.
Can't comment cause of low reputation.
I had similar issue, make sure "@react-native-picker/picker" is also installed.
for more reference look here.
1.4m articles
1.4m replys
5 comments
57.0k users