@@ -12,15 +12,15 @@ index 0946d68..1926024 100644
1212+ // dependency; AGP 9 resolves the compile classpath on its own.
1313+ implementation "androidx.savedstate:savedstate-compose:1.4.0"
1414+ implementation "androidx.lifecycle:lifecycle-runtime-compose:2.10.0"
15-
15+
1616 testImplementation "junit:junit:4.13.2"
1717 }
1818diff --git a/ios/ClerkAuthNativeView.swift b/ios/ClerkAuthNativeView.swift
1919index 5f8d2ba..b170304 100644
2020--- a/ios/ClerkAuthNativeView.swift
2121+++ b/ios/ClerkAuthNativeView.swift
2222@@ -111,7 +111,12 @@ public class ClerkAuthNativeView: ClerkNativeViewHost {
23-
23+
2424 override func makeHostedController() -> UIViewController? {
2525 let hostBackAction: (() -> Void)? = currentHostBackButton
2626- ? { [weak self] in self?.onHostBack([:]) }
@@ -31,15 +31,15 @@ index 5f8d2ba..b170304 100644
3131+ }
3232+ }
3333 : nil
34-
34+
3535 return ClerkNativeBridge.shared.makeAuthViewController(
3636diff --git a/ios/ClerkNativeBridge.swift b/ios/ClerkNativeBridge.swift
3737index e9527c6..a59ee3b 100644
3838--- a/ios/ClerkNativeBridge.swift
3939+++ b/ios/ClerkNativeBridge.swift
4040@@ -1557,6 +1557,8 @@ private struct ClerkReactEmbeddedUserProfileCustomPage: View {
4141 }
42-
42+
4343 private struct ClerkReactUserProfileCustomPageContent: View {
4444+ @Environment(\.clerkTheme) private var theme
4545+
@@ -59,23 +59,31 @@ index e9527c6..a59ee3b 100644
5959+ .background(theme.colors.background)
6060 }
6161 }
62-
62+
6363diff --git a/ios/ClerkNativeViewHost.swift b/ios/ClerkNativeViewHost.swift
64- index 4e6540a..cc16c94 100644
64+ index 4e6540a..6897350 100644
6565--- a/ios/ClerkNativeViewHost.swift
6666+++ b/ios/ClerkNativeViewHost.swift
6767@@ -5,6 +5,7 @@ public class ClerkNativeViewHost: ExpoView {
6868 private lazy var hostingCoordinator = ClerkNativeHostingCoordinator(containerView: self)
6969 private var hasInitialized: Bool = false
7070 private var configuredObserver: NSObjectProtocol?
7171+ private var isPoppingHostRoute = false
72-
72+
7373 public required init(appContext: AppContext? = nil) {
7474 super.init(appContext: appContext)
75- @@ -58,6 +59,30 @@ public class ClerkNativeViewHost: ExpoView {
76-
75+ @@ -23,6 +24,7 @@ public class ClerkNativeViewHost: ExpoView {
76+ super.didMoveToWindow()
77+
78+ guard window != nil else {
79+ + isPoppingHostRoute = false
80+ if hasInitialized {
81+ hostedViewDidDetachFromWindow()
82+ }
83+ @@ -58,6 +60,37 @@ public class ClerkNativeViewHost: ExpoView {
84+
7785 func hostedViewDidDetachFromWindow() {}
78-
86+
7987+ /// Pops the React Navigation route that contains this view without waiting for
8088+ /// the JavaScript event loop. React Native Screens reports the native dismissal
8189+ /// back to React Navigation so its state remains synchronized.
@@ -90,6 +98,13 @@ index 4e6540a..cc16c94 100644
9098+ navigationController.viewControllers.count > 1 {
9199+ isPoppingHostRoute = true
92100+ if navigationController.popViewController(animated: true) != nil {
101+ + if let coordinator = navigationController.transitionCoordinator {
102+ + coordinator.animate(alongsideTransition: nil) { [weak self] _ in
103+ + self?.isPoppingHostRoute = false
104+ + }
105+ + } else {
106+ + isPoppingHostRoute = false
107+ + }
93108+ return true
94109+ }
95110+ isPoppingHostRoute = false
@@ -102,13 +117,13 @@ index 4e6540a..cc16c94 100644
102117+
103118 private func addConfiguredObserver() {
104119 guard configuredObserver == nil else { return }
105-
120+
106121diff --git a/ios/ClerkUserProfileNativeView.swift b/ios/ClerkUserProfileNativeView.swift
107122index f2ca604..46f406d 100644
108123--- a/ios/ClerkUserProfileNativeView.swift
109124+++ b/ios/ClerkUserProfileNativeView.swift
110125@@ -47,7 +47,12 @@ public class ClerkUserProfileNativeView: ClerkUserProfileCustomPageHost {
111-
126+
112127 override func makeHostedController() -> UIViewController? {
113128 let hostBackAction: (() -> Void)? = currentHostBackButton
114129- ? { [weak self] in self?.onHostBack([:]) }
@@ -119,5 +134,5 @@ index f2ca604..46f406d 100644
119134+ }
120135+ }
121136 : nil
122-
137+
123138 return ClerkNativeBridge.shared.makeUserProfileViewController(
0 commit comments