以前在react SPA 項目中,我會通過react生命周期監聽參數的變化,然后重新請求數據,但是服務端渲染沒有此生命周期,如何監聽?原來的代碼:componentWillReceiveProps(nextProps) { const { location } = this.props; if (nextProps.location.pathname !== location.pathname) { this.setMetas();
}
}
react服務端渲染同構如何監聽url參數改變從而改變頁面顯示?
慕碼人2483693
2019-01-04 21:11:54