私はreact、redux、react-router、react-router-reduxで同形アプリを書いています。 私はsyncHistoryWithStore
にclient.jsを呼び出しています。しかし、初期ロード時には、router.locationBeforeTransitions
は常にnullです。それは私が一度移動すると設定されます。上記のコードreact router redux同形アプリの初期状態設定
const history = syncHistoryWithStore(browserHistory, store);
...
<Router routes={routes} history={history} />
client.js
からである私が反応し-ルータ再来の初期状態を設定するために手動でサーバー側のLOCATION_CHANGE
アクションを発射すべきか?
offtopic少しでも、私はあなたがそれを行う上で持っているすべてのリソースを共有することができれば同形的で好奇心を持っていますか? –
私はこの定型文から分岐しました。 https://github.com/CrocoDillon/universal-react-redux-boilerplate – sean
また、https://blog.tableflip.io/server-side-rendering-with-react-and-redux/で詳しく説明しています – sean