使用dva時,通過subscriptions中的setUp,根據路由去請求數據時,在setup函數結束時,頁面上componentDidMount並不一定已經執行完,因為dispatch是異步執行,因此,如果想給state重新賦值,要使用componentWillRecieiveProps中使用setState
使用dva時,通過subscriptions中的setUp,根據路由去請求數據時,在setup函數結束時,頁面上componentDidMount並不一定已經執行完,因為dispatch是異步執行,因此,如果想給state重新賦值,要使用componentWillRecieiveProps中使用setState
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。