在從服務器獲取數(shù)據(jù)之前更新存儲,工作正常。但是從服務器獲取數(shù)據(jù)并更新存儲之后,render() 方法沒有被調用 代碼片段 @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 存儲值后未調用組件的 render()
慕姐4208626
2023-09-28 17:02:47