René's URL Explorer Experiment


Title: [Expo] Android native UserButton becomes inert after navigation detach · Issue #9142 · clerk/javascript · GitHub

Open Graph Title: [Expo] Android native UserButton becomes inert after navigation detach · Issue #9142 · clerk/javascript

X Title: [Expo] Android native UserButton becomes inert after navigation detach · Issue #9142 · clerk/javascript

Description: Preliminary checks I reviewed the Clerk documentation. I searched open and closed issues and PRs in clerk/javascript and other Clerk repositories. I have not contacted Clerk support or Discord about this. This is a reproducible SDK bug, ...

Open Graph Description: Preliminary checks I reviewed the Clerk documentation. I searched open and closed issues and PRs in clerk/javascript and other Clerk repositories. I have not contacted Clerk support or Discord abou...

X Description: Preliminary checks I reviewed the Clerk documentation. I searched open and closed issues and PRs in clerk/javascript and other Clerk repositories. I have not contacted Clerk support or Discord abou...

Opengraph URL: https://github.com/clerk/javascript/issues/9142

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Expo] Android native UserButton becomes inert after navigation detach","articleBody":"## Preliminary checks\n\n- [x] I reviewed the Clerk documentation.\n- [x] I searched open and closed issues and PRs in `clerk/javascript` and other Clerk repositories.\n- [x] I have not contacted Clerk support or Discord about this.\n- [x] This is a reproducible SDK bug, not a support request.\n\n## Reproduction\n\nStart from Clerk's official [NativeComponentQuickstart](https://github.com/clerk/clerk-expo-quickstart/tree/main/NativeComponentQuickstart), render the native `UserButton` inside an Expo Router/React Navigation header, and add any second route:\n\n```tsx\nimport { UserButton } from '@clerk/expo/native';\nimport { Stack } from 'expo-router';\n\nexport default function Layout() {\n  return (\n    \u003cStack screenOptions={{ headerRight: () => \u003cUserButton /> }}>\n      \u003cStack.Screen name=\"index\" />\n      \u003cStack.Screen name=\"details\" />\n    \u003c/Stack>\n  );\n}\n```\n\nUse any Clerk development instance and a signed-in user with a profile image.\n\n## Description\n\nOn Android, the native Expo `UserButton` stops rendering live content and stops responding after its header is detached and reattached by navigation. It works correctly on the first render. After navigating to another route and returning, it shows the generic fallback avatar instead of the user's profile image. Tapping it no longer opens the account UI.\n\niOS is unaffected.\n\n### Steps to reproduce\n\n1. Launch the Android development build while signed in.\n2. Confirm the native `UserButton` shows the user's profile image and opens the Account UI.\n3. Navigate to any other route.\n4. Navigate back, or otherwise return to a route whose header contains the same `UserButton`.\n5. Observe the generic avatar and tap it.\n\n### Expected behavior\n\nThe profile image remains hydrated and tapping the button opens the native Account UI after any number of detach/reattach navigation cycles.\n\n### Actual behavior\n\nThe native Compose content becomes inert after its first detach. The avatar falls back to the generic image and tapping it does nothing for the remainder of the process.\n\n## Root cause\n\n`ClerkComposeNativeViewHost` creates its `Recomposer` only once, during host construction:\n\nhttps://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkComposeNativeViewHost.kt#L29-L46\n\nIt then permanently cancels that recomposer and its job on every temporary window detach:\n\nhttps://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkComposeNativeViewHost.kt#L48-L53\n\nOn reattach, `ClerkUserButtonNativeView` calls `setupView()`, but the `ComposeView` still points at the canceled parent recomposer:\n\nhttps://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkUserButtonViewModule.kt#L20-L23\n\nReact Navigation header transitions routinely detach and reattach native views, so this is a normal lifecycle event rather than destruction. No exception is emitted; the composition simply no longer updates or handles input.\n\nThe iOS host explicitly tears down its hosting controller, clears `hasInitialized`, and creates a new hosted controller when it returns to a window, which explains the platform difference:\n\nhttps://github.com/clerk/javascript/blob/main/packages/expo/ios/ClerkNativeViewHost.swift#L22-L40\n\n## Verified fix\n\nI verified a local patch that:\n\n- disposes the existing composition on detach;\n- cancels and clears the old recomposer/job;\n- creates and assigns a new parent recomposer in `onAttachedToWindow()` before the subclass calls `setupView()`.\n\nValidation on an Android API 36 emulator:\n\n- cold start: profile image rendered and Account UI opened;\n- details route → back: profile image remained and Account UI opened;\n- AI Chat tab → Home tab: profile image remained and Account UI opened;\n- repeated detach/reattach cycles: Account UI continued opening;\n- Android debug Kotlin build succeeded;\n- no recomposer, Compose lifecycle, `IllegalStateException`, or fatal runtime errors were logged.\n\nI will link a PR with the patch and regression coverage.\n\n## Environment\n\n```shell\nSystem:\n  OS: macOS 26.5.2\n  CPU: (10) arm64 Apple M4\nBinaries:\n  Node: 24.13.1\n  pnpm: 11.7.0\nnpmPackages:\n  @clerk/expo: 3.7.0\n  expo: 57.0.4\n  expo-router: 57.0.4\n  react: 19.2.3\n  react-native: 0.86.0\nDevice:\n  Android API 36 arm64 emulator\n```\n\nPublishable key omitted because the failure reproduces with any signed-in development instance and does not depend on instance configuration.\n","author":{"url":"https://github.com/D3OXY","@type":"Person","name":"D3OXY"},"datePublished":"2026-07-12T23:50:48Z","url":"https://github.com/clerk/javascript/issues/9142"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d61bed4f-d1e6-e2b2-a0a7-bafde83d622d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDF0E:BD772:127DA8A:1947CD0:6AFB6DA0
html-safe-nonce84f73d2f697aa352366cd1aed11f46714c20bd0534d7bcb30660435c8f9fbbbf
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjBFOkJENzcyOjEyN0RBOEE6MTk0N0NEMDo2QUZCNkRBMCIsInZpc2l0b3JfaWQiOiI3MzgzNzg5NzUxMzc2NzY4NDE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac132eacadeb67275ce284b50594d5d4a93f114be5b847ec456e612bd8774dc17c
hovercard-subject-tagissue:4869269708
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/clerk/javascript/9142/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ac3b206a3afdaeb2c1c39e23313d5b4c7aad39208cc122d6f311fc3fcc39bfcc/clerk/javascript/issues/9142
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ac3b206a3afdaeb2c1c39e23313d5b4c7aad39208cc122d6f311fc3fcc39bfcc/clerk/javascript/issues/9142
og:image:altPreliminary checks I reviewed the Clerk documentation. I searched open and closed issues and PRs in clerk/javascript and other Clerk repositories. I have not contacted Clerk support or Discord abou...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameD3OXY
hostnamegithub.com
expected-hostnamegithub.com
Nonecca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700
turbo-cache-controlno-preview
go-importgithub.com/clerk/javascript git https://github.com/clerk/javascript.git
octolytics-dimension-user_id49538330
octolytics-dimension-user_loginclerk
octolytics-dimension-repository_id438331492
octolytics-dimension-repository_nwoclerk/javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id438331492
octolytics-dimension-repository_network_root_nwoclerk/javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release88808b1fae5ab8a526a73e7ce5542a10eb9d6971
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/clerk/javascript/issues/9142#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fclerk%2Fjavascript%2Fissues%2F9142
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fclerk%2Fjavascript%2Fissues%2F9142
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=clerk%2Fjavascript
Reloadhttps://github.com/clerk/javascript/issues/9142
Reloadhttps://github.com/clerk/javascript/issues/9142
Reloadhttps://github.com/clerk/javascript/issues/9142
clerkhttps://github.com/clerk
javascripthttps://github.com/clerk/javascript
Codehttps://github.com/clerk/javascript
Issues45 (45)https://github.com/clerk/javascript/issues
Pull requests110 (110)https://github.com/clerk/javascript/pulls
Discussionshttps://github.com/clerk/javascript/discussions
Actionshttps://github.com/clerk/javascript/actions
Security and quality6 (6)https://github.com/clerk/javascript/security
Insightshttps://github.com/clerk/javascript/pulse
https://github.com/clerk/javascript
New issuehttps://github.com/login?return_to=https://github.com/clerk/javascript/issues/9142
New issuehttps://github.com/login?return_to=https://github.com/clerk/javascript/issues/9142
#9178https://github.com/clerk/javascript/pull/9178
[Expo] Android native UserButton becomes inert after navigation detachhttps://github.com/clerk/javascript/issues/9142#top
#9178https://github.com/clerk/javascript/pull/9178
https://github.com/wobsoriano
confirmedhttps://github.com/clerk/javascript/issues?q=state%3Aopen%20label%3A%22confirmed%22
https://github.com/D3OXY
D3OXYhttps://github.com/D3OXY
on Jul 12, 2026https://github.com/clerk/javascript/issues/9142#issue-4869269708
NativeComponentQuickstarthttps://github.com/clerk/clerk-expo-quickstart/tree/main/NativeComponentQuickstart
https://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkComposeNativeViewHost.kt#L29-L46https://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkComposeNativeViewHost.kt#L29-L46
https://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkComposeNativeViewHost.kt#L48-L53https://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkComposeNativeViewHost.kt#L48-L53
https://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkUserButtonViewModule.kt#L20-L23https://github.com/clerk/javascript/blob/main/packages/expo/android/src/main/java/expo/modules/clerk/ClerkUserButtonViewModule.kt#L20-L23
https://github.com/clerk/javascript/blob/main/packages/expo/ios/ClerkNativeViewHost.swift#L22-L40https://github.com/clerk/javascript/blob/main/packages/expo/ios/ClerkNativeViewHost.swift#L22-L40
https://github.com/D3OXY
D3OXYhttps://github.com/D3OXY
on Jul 13, 2026https://github.com/clerk/javascript/issues/9142#issuecomment-4953301650
#9143https://github.com/clerk/javascript/pull/9143
wobsorianohttps://github.com/wobsoriano
on Jul 15, 2026https://github.com/clerk/javascript/issues/9142#event-28027870605
wobsorianohttps://github.com/wobsoriano
confirmedhttps://github.com/clerk/javascript/issues?q=state%3Aopen%20label%3A%22confirmed%22
on Jul 16, 2026https://github.com/clerk/javascript/issues/9142#event-28053260559
wobsorianohttps://github.com/wobsoriano
completedhttps://github.com/clerk/javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#9178https://github.com/clerk/javascript/pull/9178
on Jul 16, 2026https://github.com/clerk/javascript/issues/9142#event-28078238168
https://github.com/wobsoriano
wobsorianohttps://github.com/wobsoriano
on Jul 16, 2026https://github.com/clerk/javascript/issues/9142#issuecomment-4993726460
Sign up for freehttps://github.com/signup?return_to=https://github.com/clerk/javascript/issues/9142
Sign in to commenthttps://github.com/login?return_to=https://github.com/clerk/javascript/issues/9142
wobsorianohttps://github.com/wobsoriano
confirmedhttps://github.com/clerk/javascript/issues?q=state%3Aopen%20label%3A%22confirmed%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.