react router 的push replace

摘要

我们在做一些query 操作的时候,经常会需要同步至url, 在这里我们可以使用 react-router-redux 实现即可


import { push } from 'react-router-redux';


this.dispath(push({
  path: 'xx',
  search: 'xx',
}));

两者的区别

push 是往 history 里面增加一层堆栈,
history 是直接替换当前url

posted @ 2018-06-25 22:29  空城夕  阅读(4125)  评论(0编辑  收藏  举报