A framework for building native applications using React
Fix culling of views having no layout breaking embedded Text event handlers (#53466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53466
This is a follow-up on D80631997. When enabling View Culling on Android, wrapped Text components would lead to event handlers set by the inner Text component not being set on the attributed string.
```
<Paragraph>
<Text onPress={myHandler}> <- This handler is not set
<RawText/>
</Text>
</Paragraph>
```
This was due to the inner Text component having no size and hence being culled by the View Culling algorithm.
This diff disables view culling for views having no size, since no layout means no valid decision can be made as to the visibility of the component within the viewport.
It also removes the change made by D80631997. This means Text views with a layout size set can be culled again.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D81044841
fbshipit-source-id: e9b01dcb8030b271876329b9b2c5bda36ba2b87a N
Nick Lefever committed
2b99204e06e8eff4cb90c7efb15341629f59a841
Parent: a4bf14a
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 8/26/2025, 7:54:54 PM