_this2.setState is not an error function in a native response

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?

+4
source share
1 answer

Found! Closed a question about github: https://github.com/facebook/react-native/issues/9357

+2
source

Source: https://habr.com/ru/post/1650913/


All Articles