You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e61d9a
Browse filesBrowse the repository at this point in the historyBrowse files
Summary:
`onTextLayout` reaches JS after the first frame with the text is drawn, so output that depends on a text's lines shows unadjusted for a few frames.
This adds `getTextLayout()` to refs of a `<Text>` not nested in another `<Text>`. It synchronously returns `{lines}`, the same shape and lines as the `onTextLayout` event, so a layout effect can use them in the same commit.
- `ParagraphShadowNode` keeps the lines it measures for `onTextLayout` and exposes them through `TextLayoutLinesProvider`, a header-only interface.
- `dom::getTextLayoutLines` reads them through that interface; `NativeDOM.getTextLayout` resolves the revision and builds the `{lines}` object.
- `Text` adds the method before the ref receives the instance, only when a ref is passed; nested texts don't get it.
Changelog:
[General][Added] - Add `getTextLayout()` to `<Text>` refs
Reviewed By: rubennorte
Differential Revision: D134142257
0 commit comments