react native object is empty

JavaScript
//when this.state.errors object is empty 
if (Object.keys(this.state.errors).length == 0) {
  this.props.updateUser(user);
  this.props.navigation.goBack();
}
Source

Also in JavaScript: