Skip to content

fix: Support children rendering on iOS HybridViews - #1444

Open
Gabriel-Pereira1788 wants to merge 5 commits into
mrousavy:mainfrom
Gabriel-Pereira1788:fix/children-rendering-ios
Open

fix: Support children rendering on iOS HybridViews#1444
Gabriel-Pereira1788 wants to merge 5 commits into
mrousavy:mainfrom
Gabriel-Pereira1788:fix/children-rendering-ios

Conversation

@Gabriel-Pereira1788

@Gabriel-Pereira1788 Gabriel-Pereira1788 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Fixed children rendering support on iOS HybridViews by correcting the method signature for mountChildComponentView and unmountChildComponentView to match React Native's official API (using index: instead of atIndex:).

Changes

  • Fixed method signature in SwiftHybridViewManager.ts template
  • Added clipsToBounds=true to HybridTestView for proper child clipping
  • Regenerated all iOS view component files with correct signatures
  • Added comprehensive test screen (ChildrenTestScreen.tsx) with 9 test cases
  • Added runtime test validation in getTests.ts

Test Cases

The fix is validated by:

  1. Visual UI Tests - ChildrenTestScreen.tsx with 9 comprehensive test cases:

    • Simple text children
    • Multiple children
    • Nested views
    • Styled children
    • Interactive children (TouchableOpacity)
    • Mixed content types
    • Dynamic visibility
    • Complex nested structures
    • Many children (10+)
  2. Runtime Test - Validation in getTests.ts

Related

This fixes children rendering not working on iOS for HybridViews. Android already supports this through ViewGroupManager.

Verification

  • ✅ bun lint-all passes
  • ✅ Generated files committed
  • ✅ Conventional commits format followed
  • ✅ All test cases added
  • ✅ No breaking changes

Visual Comparison

Before Fix (Empty boxes - children not rendering)

Simulator Screenshot - iPhone 16 - 2026-07-22 at 12 40 49

After Fix (Text visible inside boxes)

Simulator Screenshot - iPhone 16 - 2026-07-22 at 12 39 04

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
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
nitro-docs Skipped Skipped Jul 22, 2026 3:38pm

Request Review

Updated method comments to follow Nitro project conventions
with numbered steps (// 1., // 2., etc) for better readability
and consistency with existing codebase style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant