Mathias Jepsen
Mathias Jepsen

Reputation: 134

Unknown event handler property 'onTextLayout'

I've looked it up on reactnative.dev, and the Text component is supposed to have an 'onTextLayout' prop.

onTextLayout prop screenshot from reactnative.dev

I'm running the React Native version 0.62.2, and the documentation on their site says it applies for 0.62. However, when I try to use the prop in a Text component, I am shown this message:

onTextLayout used as prop on Text Installed react native version React Native warning

I need to use this prop to detect when the text starts overflowing into two lines. If anyone has another solution of how I can accomplish this without onTextLayout, that would also be very helpful.

Upvotes: 1

Views: 774

Answers (1)

Titozzz
Titozzz

Reputation: 189

It appears it's not working on react-native-web http://necolas.github.io/react-native-web/docs/?path=/docs/components-text--children

Just test your app on android/iOS and you will be fine

Upvotes: 1

Related Questions