Skip to content

fix: draw text decorations animated by Reanimated on Android - #10622

Draft
MatiPl01 wants to merge 3 commits into
mainfrom
@matipl01/android-text-decoration-relayout
Draft

MatiPl01 wants to merge 3 commits into
mainfrom
@matipl01/android-text-decoration-relayout

Conversation

@MatiPl01

@MatiPl01 MatiPl01 commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Note

This pull request was authored by AI on behalf of @MatiPl01.

Summary

On Android with React Native 0.87+, a CSS animation or transition of textDecorationLine, textDecorationColor or textDecorationStyle never shows the decoration. Since react/react-native#56768 ReactTextView.onDraw paints underline and strikethrough itself, but only while the TextView has a Layout. setText drops it and Fabric measures the view again only when its frame changed, so every UI-thread commit that changes just the text attributes leaves the next draw without decorations (iOS is unaffected). Found by @tshmieldev.

This is a React Native bug, fixed upstream in react/react-native#58579. Until that ships, after a successful commit on Android Reanimated asks the mounted Paragraph views that lost their Layout to measure themselves at their current size, which happens after the mount and before the frame is drawn. It is a no-op for views whose frame changed (Fabric already measured them) and for text updated from React commits.

Test plan

CSS Animations > Animated Properties > Base Properties > Text Decoration > Text Decoration Line on an Android emulator or device.

before-after-reanimated-fix-android-textDecorationLine.mp4

Changelog

Entry added under Unpublished in packages/react-native-reanimated/CHANGELOG.md.

… are drawn

Since React Native 0.87 ReactTextView paints underline and strikethrough in
onDraw, but only while the TextView has a Layout. setText drops it and Fabric
measures the view again only when its frame changed, so every UI-thread commit
that changes just the text attributes leaves the next draw without decorations.
After a successful commit on Android, ask the mounted Paragraph views without a
Layout to measure themselves at their current size before the frame is drawn.
@MatiPl01 MatiPl01 self-assigned this Sep 17, 2026
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f3387bb6-2cee-44a5-96ef-c7d2969a214d

📥 Commits

Reviewing files that changed from the base of the PR and between 3960f51 and e81e72e.

📒 Files selected for processing (1)
  • packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Android commit handling now collects committed paragraph view tags and requests their relayout through a platform callback. The JNI bridge forwards these tags to Kotlin. Kotlin resolves ReactTextView instances and measures eligible views with exact dimensions when their layout is missing. The changelog documents the fix for animated text decorations on Android with React Native 0.87+.

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to e81e7

The Android relayout callback runs on the required UI thread, with no concrete unresolved issue identified in the changed flow.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the primary change: fixing Android text decorations animated by Reanimated.
Description check ✅ Passed The description directly explains the Android React Native 0.87+ bug, the implemented relayout behavior, affected properties, test plan, and changelog update.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant