Functions & Hooks

measureText

function measureText(text: string, style?: TextStyle): TextMeasurement;

What text would occupy if <Text> drew it with these props - same layout, same fallback chain, so a width measured here is the width drawn.

The result is relative to the first baseline: ascent is negative, and the box runs from y + ascent to y + ascent + height.

Parameters

text

string

style?

TextStyle = {}

Returns

TextMeasurement

On this page