I'm trying to call the _addToOrder function but Error:
[TypeError: this._addToOrder is not a function. I am getting (In 'this._addToOrder ()', 'this._addToOrder' is undefined)]
I extract data from the webview with onMessage. According to the incoming data, I have to call the _addToOrder function.
class PayWtihOnlineModal extends Component {
onMessage ( event ) {
try {
if (event.nativeEvent.data == "tamam")
this._addToOrder();
}
} catch (err) {
// handle errors
}
}
_addToOrder = async () => {
try {
await this.props.BasketStore.setOrder(...);
} catch (err) {
// handle errors
}
}
}
export default PayWtihOnlineModal;