1
這裏休息:https://github.com/reactjs/react-router/issues/3077無法強制刷新瀏覽器,瀏覽事後
我以前設置我的歷史如下:
import createHistory from 'history/lib/createHashHistory';
const history = createHistory();
const middleware = syncHistory(history);
有了,我得到現在一個警告:
Warning: [react-router] It appears you have provided a deprecated history object to `<Router/>`, please use a history provided by React Router with `import { browserHistory } from 'react-router'` or `import { hashHistory } from 'react-router'`. If you are using a custom history please create it with `useRouterHistory`, see http://tiny.cc/router-usinghistory for details.
如果然而,我做任何事情來解決這個警告應用程序的初始負載(不使用哈希在URL中)將加載,我可以導航。但是,如果我堅持刷新頁面,整個事情就會死亡,只會導航到家庭網址,沒有更多。我必須通過刪除散列並生成新密鑰來實現應用程序。
我已經嘗試了以下變化:
import hashHistory from 'react-router/lib/hashHistory';
const history = hashHistory;
const middleware = syncHistory(hashHistory);
和:
import createHashHistory from 'history/lib/createHashHistory';
const history = useRouterHistory(createHashHistory)();
const middleware = syncHistory(history);
有一些改變,我可能會在升級指南錯過了什麼?
這是我的主要JSX文件:
https://github.com/awsbb/awsbb/blob/master/webpack/application.jsx#L19
我的package.json有 「*」 的所有版本。
任何人都可以提供一些見解我缺少的東西或任何進一步的信息,你需要嗎?
謝謝!