Skip to content

fix: init and defaultValue#1

Merged
janicduplessis merged 3 commits intomainfrom
@janic/fix-registry-race-and-default-value
Mar 11, 2026
Merged

fix: init and defaultValue#1
janicduplessis merged 3 commits intomainfrom
@janic/fix-registry-race-and-default-value

Conversation

@janicduplessis
Copy link
Contributor

No description provided.

runOnUI is async, so the registry may not be set up on the UI thread
by the time NativeTransformerTextInputModule.install() runs, causing
a crash when native code tries to access __rntti_registerTransformerRegistry.

Switch to executeOnUIRuntimeSync to guarantee the registry exists before
install() is called.
When defaultValue is set, Yoga measures the untransformed text for
layout. The native-side transformation happens after layout and
doesn't trigger a remeasure, resulting in incorrect sizing.

Run the transformer worklet on the JS thread to pre-transform the
defaultValue before passing it to the native TextInput, so Yoga
measures the correct text from the start.
@janicduplessis janicduplessis merged commit f49bca6 into main Mar 11, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant