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
.replace
.push
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.