Hello,
I was wondering if there is a way to clear the history of my auth stack before I navigate to my app stack.
I have 3 pages in the auth stack I have to pass through before authenticating. The code below only remove the last page as expected, but is there a way to remove all the past pages?
import { useHistory } from 'react-router-dom'
const Component = () => {
const history = useHistory();
const handleAuthentication = () => {
// logic
history.replace('/app');
}
}
The reason for this is that βswipe backβ on phone is making the app go back to auth stack. I override the hardware back button listener to not do that. However, the βswipe backβ on IOS and android were not overridden
Thanks!
ionic info:
Packages:
β@ionic/reactβ: β^7.4.2β,
β@ionic/react-routerβ: β^7.4.2β,
βreact-routerβ: β^5.3.4β,
βreact-router-domβ: β^5.3.4β,
β@types/react-routerβ: β^5.1.20β,
β@types/react-router-domβ: β^5.3.3β,
Ionic:
Ionic CLI : 7.1.1
Ionic Framework : @ionic/react 7.5.6
Capacitor:
Capacitor CLI : 5.4.1
@capacitor/android : 5.5.1
@capacitor/core : 5.5.1
@capacitor/ios : 5.5.1
Utility:
cordova-res : 0.15.4
native-run (update available: 2.0.0) : 1.7.4
System:
NodeJS : v20.10.0
npm : 10.2.3
OS : macOS Unknown
βββββββββββββββββββββββββββββββββββββββββββββββ
Ionic CLI update available: 7.1.1 β 7.1.5
Run npm i -g @ionic/cli to update
βββββββββββββββββββββββββββββββββββββββββββββββ