react-router4中history.push or history.replace的location.action都为'REPLACE'。
- history.go(-1)
- history.push
- history.replace
路由设置为:
<Route exact path="/A/a"
render={() => (<Redirect to="/A/a/aa/aaa"/>)}/>
直接history.push(‘/A/a/aa/aaa’),location.action为‘POP’,但如果history.push('/A/a'),location.action则会为‘REPLACE’
这是react-router4的改变吗?那么如果我要如何区分history.go(-1)和history.push('/A/a/aa/aaa')呢??