react-native-optimizer icon indicating copy to clipboard operation
react-native-optimizer copied to clipboard

Prevent `<Text />` `numberOfLines` optimization bailout

Open marklawlor opened this issue 2 years ago • 0 comments

The numberOfLines prop will cause the Text -> NativeText optimization to bail out. We should map numberOfLines={numberOfLines} to numberOfLines={Math.ceil(0, numberOfLines)} and remove numberOfLines from the Text -> NativeText bail out rules. We move the warning to the build step.

https://github.com/facebook/react-native/blob/441822923c9509dbb28bceacf6fc590c157e15bb/packages/react-native/Libraries/Text/Text.js#L198C7-L204

marklawlor avatar Sep 17 '23 23:09 marklawlor