I have this code for a drop down menu:
<Picker
selectedValue= {() => {this.state.attendance}}
onValueChange= {(att) => this.setState({attendance: att})}>
<Picker.Item label="Present" value="present" />
<Picker.Item label="Half Day" value="halfday" />
<Picker.Item label="Informed Absent" value="in-absent" />
<Picker.Item label="Uninformed Absent" value="un-absent" />
</Picker>
But I get the error, "_this2.setState is not a function" when the application starts. I know how response-native does not auto-bind, but from my research, the arrow syntax should fix it. Does anyone know why this error is still being thrown?
source
share