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.
question from:https://stackoverflow.com/questions/65848032/rnpickerselect-crashes-with-correct-input-for-items