mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Text need to know if is a descendant of a text in order to proper render nested text. For this react-native uses the textAncestor provider https://github.com/facebook/react-native/pull/29736#issuecomment-681116943. This provides a not so ideal DX when profiling/Debugging as the view is polluted with TextAncestor.provider on each view render (As is the main render piece this happens quite often). The idea behind of this PR is to just reset the context when view is a descendant of a text (Not so common case) rather than resetting all the time. | Before | After | | ------------- | ------------- | |  |  | From my understanding of how hooks works this shouldn't degrade the performance and didn't spot any diff profiling my app (For better or worse). ## Changelog [INTERNAL] [CHANGED] - Only reset textAncesor when is a child of text Pull Request resolved: https://github.com/facebook/react-native/pull/36520 Test Plan: https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Text/TextExample.ios.js Reviewed By: necolas Differential Revision: D44213843 Pulled By: javache fbshipit-source-id: 246ac22557dc7794741fd9732d399fe8b9256f11