1const empty = {};
2/* -------------------------
3 Plain JS for Newer Browser
4----------------------------*/
5Object.keys(empty).length === 0 && empty.constructor === Object
6// true
7/* -------------------------
8 Lodash for Older Browser
9----------------------------*/
10_.isEmpty(empty)
11// true
1//when this.state.errors object is empty
2if (Object.keys(this.state.errors).length == 0) {
3 this.props.updateUser(user);
4 this.props.navigation.goBack();
5}