onTextLayout prop doesn't work
Aleksandern opened this issue · 1 comments
Aleksandern commented
Hello.
Thank you for the component.
I noticed the onTextLayout
prop doesn't work:
<Autolink
text="text"
textProps={{
onTextLayout: (e) => {
console.log(e.nativeEvent.lines.length);
},
}}
/>
so I have to do like this:
<Text
onTextLayout={onTextLayout}
>
<Autolink
text="text"
/>
</Text>
joshswan commented
Perhaps not obvious based on the name, but textProps
is passed to non-link child Text nodes, not the main one. You should be able to just pass the prop directly:
<Autolink
text="text"
onTextLayout={(e) => {
console.log(e.nativeEvent.lines.length);
}}
/>