We use react-router-dom's history object's push() method to nagivate the user programmatically. Use history.replace() if you wish to rewrite the current router entry, rather than creating a new one.