【发布时间】:2018-12-03 11:36:31
【问题描述】:
我有以下服务器代码:
const store = configureStore({}, history);
const context: any = { store };
const app = (
<Provider store={store}>
<StaticRouter location={req.url} context={context}>
<Application />
</StaticRouter>
</Provider>
);
// render app
以及以下客户端连接路由器:
<Provider store={store}>
<ConnectedRouter history={history}>
<Application />
</ConnectedRouter>
</Provider>
我可以看到中间件已正确连接,并且正在调用 history.push 方法 here。
但是浏览器不重定向。
什么会导致浏览器不重定向?
【问题讨论】:
-
那里的
history是指window.history,还是在范围内是否有其他具有该名称的变量?另外,您的configureStore方法中有什么?
标签: react-router react-router-redux