Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(expo): apply Android theme after Clerk.initialize and use real Cl…
…erkDesign signature

Two fixes needed to make the Android theme actually take effect:

1. Call loadThemeFromAssets() AFTER Clerk.initialize() instead of before.
   Clerk.initialize() accepts a `theme` parameter that defaults to null and
   assigns it to Clerk.customTheme on every call, which was wiping out the
   theme we just loaded.

2. Use the real ClerkDesign(borderRadius: Dp) constructor signature. The
   previous code passed nonexistent fontFamily and nullable borderRadius
   parameters that don't compile against clerk-android-ui.
  • Loading branch information
chriscanin committed Apr 8, 2026
commit 221e30c298bc5cf028c490058b12a340f5a239a5
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ class ClerkExpoModule(reactContext: ReactApplicationContext) :
.apply()
}

loadThemeFromAssets()
Clerk.initialize(reactApplicationContext, pubKey)
// Must be set AFTER Clerk.initialize() because initialize()
// resets customTheme to its `theme` parameter (default null).
loadThemeFromAssets()
Comment thread
manovotny marked this conversation as resolved.

// Wait for initialization to complete with timeout
try {
Expand Down Expand Up @@ -424,10 +426,11 @@ class ClerkExpoModule(reactContext: ReactApplicationContext) :
}

private fun parseDesign(json: JSONObject): ClerkDesign {
return ClerkDesign(
fontFamily = json.optString("fontFamily", null),
borderRadius = if (json.has("borderRadius")) json.getDouble("borderRadius").dp else null
)
return if (json.has("borderRadius")) {
ClerkDesign(borderRadius = json.getDouble("borderRadius").toFloat().dp)
} else {
ClerkDesign()
}
}

private fun parseHexColor(hex: String): Color? {
Expand Down
Loading