Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IOS上的Chrome在redux/react网站上有一个重定向循环_Ios_Google Chrome_Reactjs_React Router_Redux - Fatal编程技术网

IOS上的Chrome在redux/react网站上有一个重定向循环

IOS上的Chrome在redux/react网站上有一个重定向循环,ios,google-chrome,reactjs,react-router,redux,Ios,Google Chrome,Reactjs,React Router,Redux,所以我们在IOS上的Google chrome上遇到了一个奇怪的bug。有一个不断发生的重定向循环。我们正在使用React和React路由器 我遇到了一个奇怪的问题,我在末尾添加了一个查询字符串-/#/?_k=p8ttt0,但这不是我们想要做的事情,因为它是一个看起来很奇怪的字符串,会破坏其他路由 下面是我们正在使用的一些代码 import React from 'react'; import { render } from 'react-dom'; import { Provider } fr

所以我们在IOS上的Google chrome上遇到了一个奇怪的bug。有一个不断发生的重定向循环。我们正在使用
React
React路由器

我遇到了一个奇怪的问题,我在末尾添加了一个查询字符串-
/#/?_k=p8ttt0
,但这不是我们想要做的事情,因为它是一个看起来很奇怪的字符串,会破坏其他路由

下面是我们正在使用的一些代码

import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react';
import { Router, Route, IndexRoute } from 'react-router';
import createBrowserHistory from 'history/lib/createBrowserHistory';
import { syncReduxAndRouter } from 'redux-simple-router';

const store = configureStore();
const history = createBrowserHistory(); 

syncReduxAndRouter(history, store);

render(
  <Provider store={store}>
    <div>
      <Router history={history} onUpdate={() => window.scrollTo(0, 0)}>
        <Route path="/" component={SiteContainer}>
          <IndexRoute component={HomeLayout} />
          <Route path="a" component={HomeLayout} />
          <Route path="b" component={HomeLayout} />
          <Route path="c" component={HomeLayout} />
          <Route path="d" component={HomeLayout} />

        </Route>
        <Route path="/styleguide" component={StyleguideComponent} />
      </Router>
    </div>
  </Provider>,
  document.getElementById('content')
);
从“React”导入React;
从'react dom'导入{render};
从'react redux'导入{Provider};
从'redux DevTools/lib/react'导入{DevTools,DebugPanel,LogMonitor};
从“react Router”导入{Router,Route,IndexRoute};
从“history/lib/createBrowserHistory”导入createBrowserHistory;
从“redux简单路由器”导入{syncReduxAndRouter};
const store=configureStore();
const history=createBrowserHistory();
syncReduxAndRouter(历史记录、存储);
渲染(
window.scrollTo(0,0)}>
,
document.getElementById('content')
);
以前有人遇到过这个错误吗?如果是这样的话,有解决办法吗

更新1:
所以我发现用
createHashHistory
替换
createBrowserHistory
可以解决这个问题,但它仍然在URL中使用丑陋的哈希。有没有办法避免使用这个
createHashHistory
组件?我的意思是,我只能在特定设备上使用
createHashHistory
(在本例中是
IOS
chrome,以及任何其他可能存在此问题的浏览器)。

我在一个
GitHub
问题中遇到了一个解决方案:-基本上这会告诉您将
历史记录
模块更新为

“历史记录”:“^2.0.0-rc3”

我还更新了我的
React路由器
模块,因为我遇到了一个问题,我的
React路由器
版本需要是支持
2.0.0-rc3


“react router”:“^2.0.0-rc5”

我在一个
GitHub
问题中遇到了一个解决方案:-基本上这会告诉您将
历史记录
模块更新为

“历史记录”:“^2.0.0-rc3”

我还更新了我的
React路由器
模块,因为我遇到了一个问题,我的
React路由器
版本需要是支持
2.0.0-rc3

“反应路由器”:“^2.0.0-rc5”