Skip to content

Commit d1a16ad

Browse files
MelvinBottruph01
andcommitted
Fix: Use goBack instead of navigate to prevent 404 staying in history
Navigation.navigate(ROUTES.HOME) was pushing HOME onto the navigation stack, leaving the 404 page in browser history. Using goBack(ROUTES.HOME) instead leverages the replace semantics in goUp(), removing the 404 from history before navigating to HOME. Co-authored-by: truph01 <truph01@users.noreply.github.com>
1 parent 99d6c02 commit d1a16ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pages/ErrorPage/NotFoundPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function NotFoundPage({onBackButtonPress = () => Navigation.goBack(), isReportRe
3232
>
3333
<FullPageNotFoundView
3434
shouldShow
35-
onLinkPress={() => Navigation.navigate(ROUTES.HOME)}
35+
onLinkPress={() => Navigation.goBack(ROUTES.HOME)}
3636
onBackButtonPress={() => {
3737
if (!isReportRelatedPage || !isSmallScreenWidth) {
3838
onBackButtonPress();

0 commit comments

Comments
 (0)