React router 无法强制刷新浏览器并在以后导航
此处关闭: 我以前按如下方式设置了我的历史记录:React router 无法强制刷新浏览器并在以后导航,react-router,React Router,此处关闭: 我以前按如下方式设置了我的历史记录: 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
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.
以及:
升级指南中是否有我可能遗漏的更改内容
这是我的主要jsx文件:
My package.json在所有版本中都有“*”
有人能提供一些关于我遗漏的东西或你需要的任何进一步信息的见解吗
谢谢 我有:
在我的脑海中,但没有放置href=“/”或其他链接
删除此节点或向其添加href=“/”修复了硬刷新问题。检查历史库中的“useBasename”中是否存在实际错误。我有:
在我的脑海中,但没有放置href=“/”或其他链接
删除此节点或向其添加href=“/”修复了硬刷新问题。检查历史库中的“useBasename”中是否存在实际错误
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);