Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions apps/mobile/src/features/settings/SettingsAuthRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useAuth } from "@clerk/expo";
import { AuthView, UserProfileView } from "@clerk/expo/native";
import { StackActions, useNavigation } from "@react-navigation/native";
import { NativeStackScreenOptions } from "../../native/StackHeader";
import { useEffect } from "react";
import { useCallback, useEffect } from "react";
import { View } from "react-native";

import { hasCloudPublicConfig } from "../cloud/publicConfig";
Expand All @@ -21,16 +21,18 @@ export function SettingsAuthRouteScreen() {

function ConfiguredSettingsAuthRouteScreen() {
const { isLoaded, isSignedIn } = useAuth({ treatPendingAsSignedOut: false });
const navigation = useNavigation();
const handleHostBack = useCallback(() => navigation.goBack(), [navigation]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Host back omits stack fallback

Medium Severity

handleHostBack always calls navigation.goBack(). With @clerk/expo 4.2.0, onHostBack shows a root back control on AuthView and UserProfileView even when the nested settings stack has no prior route, so the button can do nothing after shallow navigation or some deep links.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f01e573. Configure here.


return (
<>
<NativeStackScreenOptions options={{ title: isSignedIn ? "Account" : "Sign in" }} />
<NativeStackScreenOptions options={{ headerShown: false }} />
<View collapsable={false} className="flex-1 overflow-hidden bg-sheet">
{isLoaded ? (
isSignedIn ? (
<UserProfileView isDismissible={false} />
<UserProfileView isDismissible={false} onHostBack={handleHostBack} />
) : (
<AuthView isDismissible={false} />
<AuthView isDismissible={false} onHostBack={handleHostBack} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank screen lacks back control

Low Severity

Hiding the native stack header with headerShown: false while Clerk views render only after isLoaded leaves an empty sheet with no in-screen back control during hydration. Previously the host header stayed visible and offered back navigation for that interval.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f01e573. Configure here.

)
) : null}
</View>
Expand Down
68 changes: 34 additions & 34 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ allowBuilds:

catalog:
"@clerk/backend": 3.14.0
"@clerk/clerk-js": 6.25.12
"@clerk/clerk-js": 6.25.13
"@clerk/electron": 0.0.24
"@clerk/electron-passkeys": 0.0.3
"@clerk/expo": 4.1.2
"@clerk/react": 6.12.9
"@clerk/shared": 4.25.9
"@clerk/expo": 4.2.0
"@clerk/react": 6.12.10
"@clerk/shared": 4.25.10
"@effect/atom-react": 4.0.0-beta.103
"@effect/openapi-generator": 4.0.0-beta.103
"@effect/platform-bun": 4.0.0-beta.103
Expand All @@ -53,11 +53,11 @@ catalog:

minimumReleaseAgeExclude:
- "@clerk/backend@3.14.0"
- "@clerk/clerk-js@6.25.12"
- "@clerk/clerk-js@6.25.13"
- "@clerk/electron@0.0.24"
- "@clerk/expo@4.1.2"
- "@clerk/react@6.12.9"
- "@clerk/shared@4.25.9"
- "@clerk/expo@4.2.0"
- "@clerk/react@6.12.10"
- "@clerk/shared@4.25.10"
- "@distilled.cloud/aws@0.30.2"
- "@distilled.cloud/axiom@0.30.2"
- "@distilled.cloud/cloudflare@0.30.2"
Expand Down
Loading