When you render <Toggle isOn={wifi}>Wi-Fi</Toggle>, nothing draws a toggle in JavaScript. React describes it, Fabric mounts it, SwiftUI draws it, and Yoga fits it into the rest of your layout. This page follows a component through each step.
1. React describes the view
Your component returns an element with props, as usual. The props are the SwiftUI initializer's parameters, and modifiers holds the compose() chain as a plain list of steps, in order. Nothing has touched native code yet. It's just a description.
<Text modifiers={compose().font('headline').padding(12)}>Hello</Text>2. Fabric mounts it
Every SwiftUI component is a Fabric component, React Native's own kind of native component. So Fabric reconciles, mounts, updates and unmounts it exactly like a View. Your component isn't a special root, and it isn't a separate React tree.
On the native side, the component's view hosts SwiftUI. When a prop changes, only that prop goes across, and the SwiftUI view updates in place. Your view isn't torn down and rebuilt.
3. SwiftUI draws it
The hosting view builds the real SwiftUI view from the props, then applies the modifiers one by one in the order you chained them. That's the same code a Swift app would run, with the same typed calls into SwiftUI. So system styling, animation, accessibility and Dynamic Type all behave as they do in a native app.
SwiftUI components nested inside each other don't each get their own hosting controller. An inner component joins the SwiftUI tree of the outermost one, so a List of Sections of Toggles is one SwiftUI hierarchy. That's what lets SwiftUI's environment, styles and animations flow down to children as they do in Swift.
4. SwiftUI and Yoga agree on size
Layout is where most bridges between UI systems break. Here, each side decides what it's best at and tells the other.
SwiftUI views inside React layout. SwiftUI measures the view for the space Yoga offers it. That measurement goes into the component's Fabric shadow node, and Yoga places the view using it. A Text is as tall as SwiftUI says it is, at whatever width you give it.
React content inside SwiftUI. When you put your own components inside a SwiftUI view, they become children in the SwiftUI layout. SwiftUI proposes a width. Yoga lays out your React content at that width, and the resulting size goes back to SwiftUI, which positions the child. So the child gets an exact size, not an estimate.
<List>
<Section header="Account">
<ProfileCard user={user} /> {/* your React component, laid out by Yoga */}
<Toggle isOn={sync}>Sync</Toggle>
</Section>
</List>Neither side overrides the other, so nesting works at any depth: SwiftUI inside React inside SwiftUI.
5. Changes flow both ways
- From React: when state changes, React re-renders, Fabric sends the changed props, and SwiftUI updates the affected views. Wrap the change in
withAnimationand SwiftUI animates it. - From SwiftUI: when someone flips a toggle or drags a slider, SwiftUI writes to the binding, which updates your React state. Events like
onTapGesturecall your JavaScript functions with typed arguments.
What it avoids
The library has no separate React Native roots inside native views, doesn't serialize your component tree to JSON, and never passes sizes around by hand to keep layouts in sync. Every update goes through Fabric, the same path as any other React Native view.