2017-07-30 18 views
0

再レンダリングルータ識別子を反応します。しかし、一部には、無限ループを取得したり、それが一度 this.props.getUserPage()レンダリングされている:は、私はこのような構造を使用

import axios from 'axios' 

export function getUserPage(identifier) { 
    return dispatch => { 
    return axios.get('/Q/userPage/' + identifier) 
    } 
} 

例:私はshenburak /での私のリンクを/ burakshenアドレスに行くとき、それは再レンダリング

ではありません

答えて

0

私はこの

componentDidMount() { 
    this.getUserPage() 
    } 
    componentWillReceiveProps() { 
    setTimeout(() => { 
     this.getUserPage() 
    }, 1) 
    } 

ようなソリューションcomponentDidMount()(ページオープン componentWillReceivePropsにレンダリング)再レンダリングを生産したが、それはsetTimeoutを

なしでは動作しません。

良い方法がありますか?

関連する問題