問題描述:當(dāng)在瀏覽器中刷新頁面時,如下示例代碼:classTestextendsComponent{constructor(props){super(props)this.state={}}componentWillMount(){//獲取所有活動數(shù)據(jù)...code}render(){const{Test}=this.props;console.log(Test)return(這是一段測試代碼)}會發(fā)現(xiàn)在瀏覽器后臺打印出多次Test,其中前幾次多為空對象,那么應(yīng)該如何避免這種情況呢?
有沒有人遇到過這個問題哈!如何避免react(dva.js)多次渲染?各位有什么建議?
暮色呼如
2019-06-09 09:02:16