Go back with ionic React and capacitor

Hey guys am using the New ionic react and am trying to implement the hardware back button am able to use a capacitor to find a button event but thats all, ive tried the history.goBack() but it’s still just sending me to the home route, any ideas?