使用react-router(^2.1) 在 android 4.3版本下go(-1)出现异常

#1

多路由切换使用react-router history api,在android 4.4版本及以上以及ios上均表现正常,但是在andriod 4.3及以下就会出现异常。具体情况如下图:

以上模拟history历史记录的堆栈,replace使用向下箭头,表示替换,push使用横向箭头,表示进入。

在4.4及以上,但使用go(-1)/goBack()时,会从/path4返回到/path3,表现正常;
在4.3及以下,使用go(-1)/goBack()时,会返回到第一个replace的路由,也就是图中的/path1,表现异常。

具体react-router版本

部分代码:

import {Router, hashHistory} from 'react-router';
import {syncHistoryWithStore} from 'react-router-redux';
...
const store = configureStore(hashHistory);
const history = syncHistoryWithStore(hashHistory, store);

<Provider store={store}>
    <div style={{height:'100%'}}>
          <Router history={history} routes={routes} />
    </div>
</Provider>

视图中使用(简单构造视图)


import React from 'react';
import ReactDOM from 'react-dom';

export default React.createClass({
    orderBack() {
        let { history } = this.props;
        history.goBack();
    },

    render() {
        return (
            <a onClick={ this.orderBack }>返回</a>
        );
    }
});

希望遇到上述问题的朋友们能够给予帮助,谢谢!

#2

木有人遇到么?:pensive: