Reactjs ConnectedOuter重定向到'/';初始渲染时在页面上重新加载

Reactjs ConnectedOuter重定向到'/';初始渲染时在页面上重新加载,reactjs,redux,connected-react-router,Reactjs,Redux,Connected React Router,我有一个React Redux应用程序,带有React路由器和连接的React路由器(能够在Redux操作中更改位置): 这很好,但我遇到了一个我不理解的行为: 当我通过redux操作触发一个位置时,一切正常。 但是当我用url/projects重新加载一个页面(=浏览器刷新)时,一个@@router/LOCATION\u CHANGE操作被调度到/ 这种位置变化只发生在生产模式下。 在development模式下(使用react hot loader),正确加载url 如果我用react ro

我有一个React Redux应用程序,带有React路由器和连接的React路由器(能够在Redux操作中更改位置):

这很好,但我遇到了一个我不理解的行为:

当我通过redux操作触发一个位置时,一切正常。 但是当我用url
/projects
重新加载一个页面(=浏览器刷新)时,一个
@@router/LOCATION\u CHANGE
操作被调度到
/

这种位置变化只发生在
生产模式下。
在
development
模式下(使用
react hot loader
),正确加载url

如果我用
react router dom
中的
BrowserRouter
替换
connectedexter
,则
生产模式和
开发模式下的一切都很好

在管线的初始渲染时,历史对象如下所示(如预期):

但不知何故,
ConnectedRouter
执行重定向

欢迎任何帮助


已编辑:以下是路线代码:

const routes = [
  {
    path: '/',
    exact: true,
    component: Home,
  },
  {
    path: '/projects',
    exact: true,
    component: Projects,
  },

  ...
];

你能显示你的路由模式吗?@Spacemoose:我已经编辑了我的问题并添加了相同的问题,你找到解决方案了吗?我有相同的问题,解决方案在这里-你解决了吗??
import { push } from 'connected-react-router';
...
export const gotoProjects = () => {
  return async dispatch => {
    dispatch(push('/projects'));
  };
};
{
  "history": {
    "length": 6,
    "action": "POP",
    "location": {
      "pathname": "/projects",
      "search": "",
      "hash": ""
    }
  }
}
const routes = [
  {
    path: '/',
    exact: true,
    component: Home,
  },
  {
    path: '/projects',
    exact: true,
    component: Projects,
  },

  ...
];