Skip to content

feat(expo): support custom logos in native AuthView#9163

Open
swolfand wants to merge 1 commit into
mainfrom
sam/mobile-590-expo-native-custom-logo
Open

feat(expo): support custom logos in native AuthView#9163
swolfand wants to merge 1 commit into
mainfrom
sam/mobile-590-expo-native-custom-logo

Conversation

@swolfand

@swolfand swolfand commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a logo prop to the Expo native AuthView, allowing apps to replace the dashboard-configured logo with arbitrary React Native content on Android and iOS.

The React element is mounted as the native view's single child and rehosted inside the Clerk Compose/SwiftUI logo slot while preserving its React Native layout dimensions. Callers retain control over sizing, spacing, and accessibility.

This ports the custom logo-view APIs introduced by clerk/clerk-android#801 and clerk/clerk-ios#520.

simulator_screenshot_382FAA65-2126-47AE-B6C1-F748B1F09FFB image

Summary by CodeRabbit

  • New Features

    • Added support for custom logos in Expo’s native AuthView.
    • Custom React Native logo content is now supported on both iOS and Android.
    • Apps can replace the dashboard-configured logo and control the logo’s sizing, spacing, and accessibility behavior.
  • Tests

    • Added coverage verifying custom logos are passed to the native authentication view.

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jul 14, 2026 8:04pm
swingset Ready Ready Preview, Comment Jul 14, 2026 8:04pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 380a291

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Custom React Native logo content is now supported by Expo AuthView. The prop is forwarded as a native child, hosted and resized on Android Compose and iOS SwiftUI, and covered by a unit test and patch changeset.

Custom AuthView logo

Layer / File(s) Summary
AuthView logo contract and forwarding
packages/expo/src/native/AuthView.types.ts, packages/expo/src/native/AuthView.tsx, packages/expo/src/native/__tests__/AuthView.test.tsx, .changeset/expo-native-custom-logo.md
AuthView accepts an optional logo React element, forwards it as a non-collapsible child, tests the forwarding, and records the patch release.
Android logo hosting
packages/expo/android/src/main/java/expo/modules/clerk/ClerkAuthViewModule.kt
The Android native view tracks logo dimensions, hosts the React view through Compose, and manages logo child insertion and removal.
iOS logo hosting
packages/expo/ios/ClerkAuthNativeView.swift, packages/expo/ios/ClerkNativeBridge.swift
The iOS native view tracks logo lifecycle and bounds, passes logo data through the bridge, and embeds the view in the hosted authentication UI.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ExpoApp
  participant AuthView
  participant NativeAuthView
  participant PlatformAuthUI
  ExpoApp->>AuthView: provide logo React element
  AuthView->>NativeAuthView: render logo child
  NativeAuthView->>NativeAuthView: measure and track logo view
  NativeAuthView->>PlatformAuthUI: provide logo view and size
  PlatformAuthUI->>PlatformAuthUI: render custom logo
Loading

Possibly related PRs

  • clerk/javascript#9154: Modifies the same Expo native logo-rendering paths with a separate logo sizing parameter.

Suggested reviewers: mikepitre, wobsoriano, seanperez29

Poem

I’m a rabbit with a logo to share,
Hopping custom pixels through native air.
Android measures, iOS aligns,
Compose and SwiftUI draw the designs.
A tiny prop now blooms just right—
Custom logos bound in sight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding custom logo support to the native Expo AuthView.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9163

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9163

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9163

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9163

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9163

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9163

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9163

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9163

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9163

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9163

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9163

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9163

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9163

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9163

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9163

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9163

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9163

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9163

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9163

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9163

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9163

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9163

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9163

commit: 380a291

@swolfand swolfand requested review from mikepitre, seanperez29 and wobsoriano and removed request for wobsoriano July 14, 2026 22:50
@swolfand swolfand marked this pull request as ready for review July 14, 2026 22:50
@github-actions

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-14T22:53:24.246Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 1
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 1

@clerk/expo

Current version: 3.7.5
Recommended bump: MINOR → 3.8.0

Subpath ./native

🟢 Additions (1)

Added: AuthViewProps.logo
+ logo?: ReactElement;

Added property AuthViewProps.logo


Report generated by Break Check

Last ran on 380a291.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/expo/ios/ClerkAuthNativeView.swift`:
- Around line 81-87: Update the logoBoundsObservation callback and its
asynchronous main-thread block so queued work reads the current logo view bounds
when it executes, rather than applying the asynchronously captured bounds.size.
Continue validating the view identity and only update logoSize and call
setNeedsHostedViewUpdate when the latest size differs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 62273dd8-3af2-454f-acf8-27bbd45b925c

📥 Commits

Reviewing files that changed from the base of the PR and between 99ac79f and 380a291.

📒 Files selected for processing (7)
  • .changeset/expo-native-custom-logo.md
  • packages/expo/android/src/main/java/expo/modules/clerk/ClerkAuthViewModule.kt
  • packages/expo/ios/ClerkAuthNativeView.swift
  • packages/expo/ios/ClerkNativeBridge.swift
  • packages/expo/src/native/AuthView.tsx
  • packages/expo/src/native/AuthView.types.ts
  • packages/expo/src/native/__tests__/AuthView.test.tsx

Comment on lines +81 to +87
logoBoundsObservation = view.observe(\.bounds, options: [.new]) { [weak self, weak view] _, change in
guard let self, let view, let bounds = change.newValue else { return }
DispatchQueue.main.async { [weak self, weak view] in
guard let self, let view, self.logoView === view, self.logoSize != bounds.size else { return }
self.logoSize = bounds.size
self.setNeedsHostedViewUpdate()
}

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Avoid applying a stale asynchronously captured logo size.

Rapid bounds changes can queue older bounds.size values after layoutSubviews() has recorded a newer size, briefly regressing the hosted logo dimensions.

Proposed fix
     logoBoundsObservation = view.observe(\.bounds, options: [.new]) { [weak self, weak view] _, change in
-      guard let self, let view, let bounds = change.newValue else { return }
+      guard let self, let view, change.newValue != nil else { return }
       DispatchQueue.main.async { [weak self, weak view] in
-        guard let self, let view, self.logoView === view, self.logoSize != bounds.size else { return }
-        self.logoSize = bounds.size
+        guard let self, let view, self.logoView === view else { return }
+        let currentSize = view.bounds.size
+        guard self.logoSize != currentSize else { return }
+        self.logoSize = currentSize
         self.setNeedsHostedViewUpdate()
       }
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
logoBoundsObservation = view.observe(\.bounds, options: [.new]) { [weak self, weak view] _, change in
guard let self, let view, let bounds = change.newValue else { return }
DispatchQueue.main.async { [weak self, weak view] in
guard let self, let view, self.logoView === view, self.logoSize != bounds.size else { return }
self.logoSize = bounds.size
self.setNeedsHostedViewUpdate()
}
logoBoundsObservation = view.observe(\.bounds, options: [.new]) { [weak self, weak view] _, change in
guard let self, let view, change.newValue != nil else { return }
DispatchQueue.main.async { [weak self, weak view] in
guard let self, let view, self.logoView === view else { return }
let currentSize = view.bounds.size
guard self.logoSize != currentSize else { return }
self.logoSize = currentSize
self.setNeedsHostedViewUpdate()
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/expo/ios/ClerkAuthNativeView.swift` around lines 81 - 87, Update the
logoBoundsObservation callback and its asynchronous main-thread block so queued
work reads the current logo view bounds when it executes, rather than applying
the asynchronously captured bounds.size. Continue validating the view identity
and only update logoSize and call setNeedsHostedViewUpdate when the latest size
differs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant