What is the trade off between history push and replace?

后端 未结 2 668
轮回少年
轮回少年 2020-12-14 14:25

I use History package to redirect invalid URL to 404 page on my react component.

I use .replace instead of .push simply because I don\'t wa

2条回答
  •  粉色の甜心
    2020-12-14 15:30

    router.replace acts like router.push, the only difference is that it navigates without pushing a new history entry, as its name suggests - it replaces the current entry.

提交回复
热议问题