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

猜你喜欢

转载自www.cnblogs.com/huxiaoyun90/p/9226670.html