Module 02 Β· Host & the children model β Lesson 1 of 1 Β· ~9 min
Composing native children
The magic word is Children()
How does <Host><HStack><Button/><Button/></HStack></Host> turn React children into native SwiftUI subviews? One function: Children(). Inside a SwiftUI-native view's body, calling Children() renders whatever React children were passed, as native views, right at that spot.
This is the whole composition model. A container view (an HStack, a VStack, a card) is just a SwiftUI layout whose body places Children() inside it.
In an interview, say: "
@expo/uicomposes native children through aChildren()call in the SwiftUI body β React children are mounted as native subviews at that point in the layout. That's what lets you nest native controls declaratively from JS."