mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
afb543683c
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51566 changelog: [internal] Expose [revision](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h#L229) of shadow node in Fantom tests. This makes it possible to write tests verifying that shadow nodes are only cloned when they should. Even though excessive cloning does not usually lead to bugs, it may lead to performance problems. Also introduce a test showing a performance problem where changing height of "Sibling" view from 1 to 2 will lead to component `D` being cloned by Yoga. Component D is not affected by the size change of Sibling and the clone is unnecessary. ```jsx <ScrollView> <View id="Sibling" style={{ height: 1 }} /> <View id="A"> <View id="B"> <View id="C"> <View id="D" ref={ref} /> </View> </View> </View> </ScrollView> ``` Reviewed By: rshest Differential Revision: D75287261 fbshipit-source-id: ea5acb2f5d7ba6e1e5bf895d8f82a16471122ec5