fix: Support children rendering on iOS HybridViews - #1444
Open
Gabriel-Pereira1788 wants to merge 5 commits into
Open
fix: Support children rendering on iOS HybridViews#1444Gabriel-Pereira1788 wants to merge 5 commits into
Gabriel-Pereira1788 wants to merge 5 commits into
Conversation
Fixed method signature for mountChildComponentView/unmountChildComponentView to match React Native's official API (index: instead of atIndex:). This allows React Native to properly mount and unmount child views in HybridViews on iOS. Changes: - Updated SwiftHybridViewManager template to use correct method signature - Added clipsToBounds=true to HybridTestView for proper child clipping - Regenerated all iOS view component files with correct signatures - Added ChildrenTestScreen.tsx with comprehensive test cases
Added 6 additional test cases to ChildrenTestScreen: - Test 4: Styled children (colors, sizes, weights) - Test 5: Interactive children (TouchableOpacity with counter) - Test 6: Mixed content types (text, button, view) - Test 7: Dynamic visibility (show/hide children) - Test 8: Complex nested structure with multiple levels - Test 9: Many children (12+ items) These tests validate various edge cases and real-world scenarios for children rendering on iOS HybridViews.
- Remove unused imports (FlatList, Animated) - Extract inline styles to StyleSheet definitions - Use consistent style naming for testView variants
Added runtime test to validate HybridView children rendering support. The test ensures the view object is properly initialized. Full rendering validation is done visually in ChildrenTestScreen.tsx
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Updated method comments to follow Nitro project conventions with numbered steps (// 1., // 2., etc) for better readability and consistency with existing codebase style.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed children rendering support on iOS HybridViews by correcting the method signature for
mountChildComponentViewandunmountChildComponentViewto match React Native's official API (usingindex:instead ofatIndex:).Changes
SwiftHybridViewManager.tstemplateclipsToBounds=truetoHybridTestViewfor proper child clippingChildrenTestScreen.tsx) with 9 test casesgetTests.tsTest Cases
The fix is validated by:
Visual UI Tests -
ChildrenTestScreen.tsxwith 9 comprehensive test cases:Runtime Test - Validation in
getTests.tsRelated
This fixes children rendering not working on iOS for HybridViews. Android already supports this through ViewGroupManager.
Verification
Visual Comparison
Before Fix (Empty boxes - children not rendering)
After Fix (Text visible inside boxes)