为什么 onLayout 不会在子文本中触发?

Fab*_*hor 5 react-native

我有一个关于 onLayout 事件的问题

代码

<View>
  <Text>
    <Text onLayout={e => {console.log("this isn't triggered!")}}>{"foo"}</Text>
  </Text>
</View>
Run Code Online (Sandbox Code Playgroud)

B代码

<View>
  <Text onLayout={e => {console.log("here the event it is called, but I need call in a SubText")}}>{"foo"}</Text>
</View>
Run Code Online (Sandbox Code Playgroud)

dus*_*awn 1

我在 RN repo 上发现了这个相关的错误:https://github.com/facebook/react-native/issues/11650。仍在寻找测量嵌套文本的方法