You can check if the current location is the initial entry in the history stack by checking if history.index === 0.
Question 20 of 20 in useHistory Quiz