check property of state is empty react code example
Example: react native object is empty
//when this.state.errors object is empty
if (Object.keys(this.state.errors).length == 0) {
this.props.updateUser(user);
this.props.navigation.goBack();
}