From 8f0713fd4bfdb8ece5616c9aa47a20ee381b792e Mon Sep 17 00:00:00 2001 From: Nick Lefever Date: Tue, 2 Sep 2025 03:25:54 -0700 Subject: [PATCH] Add test for empty layout culling skip (#53551) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53551 See title. Follow up on D81044841 Changelog: [Internal] Reviewed By: rshest Differential Revision: D81447133 fbshipit-source-id: 7e6ca4523401c30c4861606c795f306193d97a15 --- .../__tests__/ScrollView-viewCulling-itest.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js b/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js index c903094e35f..36299230016 100644 --- a/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js +++ b/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js @@ -2607,3 +2607,35 @@ describe('horizontal ScrollView in RTL script', () => { ]); }); }); + +describe('Views with no layout', () => { + it('are not culled', () => { + const root = Fantom.createRoot({viewportWidth: 100, viewportHeight: 100}); + + Fantom.runTask(() => { + root.render( + + + + + + , + ); + }); + + expect(root.takeMountingManagerLogs()).toEqual([ + 'Update {type: "RootView", nativeID: (root)}', + 'Create {type: "ScrollView", nativeID: (N/A)}', + 'Create {type: "View", nativeID: (N/A)}', + 'Create {type: "View", nativeID: "viewWithLayout"}', + 'Create {type: "View", nativeID: "viewWithoutLayout"}', + 'Insert {type: "View", parentNativeID: (N/A), index: 0, nativeID: "viewWithLayout"}', + 'Insert {type: "View", parentNativeID: (N/A), index: 1, nativeID: "viewWithoutLayout"}', + 'Insert {type: "View", parentNativeID: (N/A), index: 0, nativeID: (N/A)}', + 'Insert {type: "ScrollView", parentNativeID: (root), index: 0, nativeID: (N/A)}', + ]); + }); +});