i'm using expo for my android app and trying to make a Picker.
I currently have 3 Picker.Items
and everytime i click on one of it (to change the current Picker value), it gives me error.
I've searched for the fix, read the documentation, etc. but i still can't find my solution to this.
Here is my code
state = { value: "" };
updatePicker = val => {
this.setState({ value: val });
};
and below is my syntax inside my app class
<Picker
selectedValue={this.state.selectedValue}
onValueChange={updateValue}
>
<Picker.Item key="1" label="Test 1" value="test 1" />
<Picker.Item key="2" label="Test 2" value="test 2" />
<Picker.Item key="3" label="Test 3" value="test 3" />
</Picker>
this somehow gives me this error
_this.setState is not a function. (In '_this.setState({ value: value})', '_this.setState' is undefined)
thank you in advanced