I need to get the previous two pages user has visited to display a button, how could this be achieved using react location? currently I am doing location.state.previousPa
location.state.previousPa