Updating store before fetching data from server, works fine.. But after fetching data from from server and updating store, render() method not getting invoked code snippet
@action
static getPartner(partnerParams) {
store.invitationDetails.invitingOrgPartnerName = ""; // here render() is getting invoked
fetchPartner(partnerParams)
.then((data) => data.json())
.then(function (result) {
if (result.success) {
if (result.alreadyPartner) {
runInAction(() => {
store.invitationDetails.invitingOrgPartnerName = result.partnerName; // here render() is NOT getting invoked
});
}
}
})
.catch((e) => {
console.info("Failed getting partners", e);
});
}
Mobx works perfectly in most of the cases but not always
You should use extendObservable Please follow this ExtendObservable