2016-05-03 7 views
0

問題: 最初にルートURLに移動すると、正しいページがレンダリングされます。ナビゲートもうまく動作します。私は、次のエラーでアプリがクラッシュrefreshを打ったときしかし、:リアルーターを使用しているときにハンドルページがリフレッシュされます

instrument.js:112 Uncaught TypeError: Cannot read property 'length' of undefined 

をこれが instrument.js:112内の関数です。 computedStatesundefinedです。

/** 
* Runs the reducer on invalidated actions to get a fresh computation log. 
*/ 
function recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds) { 
    // Optimization: exit early and return the same reference 
    // if we know nothing could have changed. 
    if (minInvalidatedStateIndex >= computedStates.length && computedStates.length === stagedActionIds.length) { 
    return computedStates; 
    } 

localStorage.clear()を実行してページを更新すると、再びアプリが戻ってきます。問題の責任かもしれない

パッケージ:

"react-router": "^2.0.0", 
"react-router-redux": "^4.0.0", 
"redux-localstorage": "^0.4.0", 

ルーターを反応させる際に使用しているページが更新されます処理するための最良の方法は何ですか?

答えて

0

私の経験上、リアクタールーターはページをリフレッシュする際に問題がありません。ローカルストレージに問題があり、ページを更新するときに問題が発生しているようです。最初にページを読み込んだ後に、ローカルストレージの内容を調べることをお勧めします。

関連する問題