I'm new in React Native. But i'm aware if this.setState method is run in asynchronous mode.
I have a snippet code like this :
async doSave() {
await this.props.takeCustomerServiceTicket(this.state.name, this.state.address, this.state.password);
await this.setState({
name: '',
address: '',
password: ''
});
};
What i want to ask are :
Is setState can be await like that? the code not show error, but it really effective to make it await ?
Is my code really synchronous after i use async await like that?
I'm afraid about by reference, are name, address, password that passed via takeCustomerServiceTicket still exist until the function finish ? or it loss because my setState ?