-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix(mobile): repair Clerk auth navigation headers #5140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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"; | ||
|
|
@@ -21,16 +21,18 @@ export function SettingsAuthRouteScreen() { | |
|
|
||
| function ConfiguredSettingsAuthRouteScreen() { | ||
| const { isLoaded, isSignedIn } = useAuth({ treatPendingAsSignedOut: false }); | ||
| const navigation = useNavigation(); | ||
| const handleHostBack = useCallback(() => navigation.goBack(), [navigation]); | ||
|
|
||
| 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} /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blank screen lacks back controlLow Severity Hiding the native stack header with Reviewed by Cursor Bugbot for commit f01e573. Configure here. |
||
| ) | ||
| ) : null} | ||
| </View> | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.


There was a problem hiding this comment.
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
handleHostBackalways callsnavigation.goBack(). With@clerk/expo4.2.0,onHostBackshows a root back control onAuthViewandUserProfileVieweven 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)
apps/mobile/src/features/settings/SettingsAuthRouteScreen.tsx#L32-L35Reviewed by Cursor Bugbot for commit f01e573. Configure here.