mobx-persist icon indicating copy to clipboard operation
mobx-persist copied to clipboard

Possible Unhandled Promise Rejection(id: 0): TypeError: No default value

Open Ananthakr opened this issue 6 years ago • 0 comments

This happens only in android without remote js debug.

Here is my store:

class UserStore {

  @observable
  token = null;

  @observable
  location = null;

  @observable
  mobile_number = null;

  @action.bound
  updateToken(token = "") {
    this.token = token;
  }

  @action.bound
  updateLocation(location) {
    this.location = location;
  }

  @action.bound
  updateMobileNumber(mobile_number) {
    this.mobile_number = mobile_number;
  }
}

class RootStore {
  @persist("object")
  @observable
  userStore = new UserStore();
}

Here is hydrate call

 hydrate("userStore", this.props.store, {
      token: null,
      location: null,
      mobile_number: null
    }).then(() => {
      console.log("UserStore obtained");
    });

Ananthakr avatar Oct 30 '18 17:10 Ananthakr