Skip to content

Text: support onTextLayout - #2987

Merged
zoontek merged 2 commits into
masterfrom
add-on-text-layout
Nov 27, 2026
Merged

zoontek merged 2 commits into
masterfrom
add-on-text-layout

Conversation

@zoontek

@zoontek zoontek commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Adds onTextLayout to Text.

  • Called with the lines of the outermost Text: position, size, text, and font metrics
  • Called again when the size, text, styles, or fonts change
  • With numberOfLines={1}, lines stop at the edge of the box
  • New example on the Text page of the example app

@zoontek
zoontek requested review from Kudo and hassankhan November 27, 2026 11:48
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Size Change: +1.29 kB (+1.33%)

Total Size: 97.8 kB

📦 View Changed
Filename Size Change
packages/react-native-web/dist/exports/Text/index.js 1.47 kB +25 B (+1.73%)
packages/react-native-web/dist/modules/useTextLayout/index.js 1.26 kB +1.26 kB (new file) 🆕

compressed-size-action

@zoontek
zoontek merged commit c58b3af into master Nov 27, 2026
5 checks passed
@zoontek
zoontek deleted the add-on-text-layout branch November 27, 2026 13:36
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.

2 participants