This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 57).
RNHostView
A cross-platform component for hosting React Native views inside @expo/ui views.
Hosts a React Native view subtree inside a universal @expo/ui layout. On Android and iOS, it re-exports the platform-native RNHostView for Jetpack Compose/RNHostView for SwiftUI, so React Native children bridge into the surrounding Compose/SwiftUI tree. On web, there is no native host tree to bridge into, so it falls back to a React Native View that wraps the children.
Note: Pass a single React Native element as the child.
RNHostViewmeasures and lays out only its first child, so wrap several views in one parentViewand let that view arrange them.


Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Basic usage
Place a React Native view subtree anywhere inside a universal @expo/ui layout.
Fill parent vs. match child
By default RNHostView fills its native parent. Set matchContents to have it shrink to fit its React Native children instead.
API
import { RNHostView } from '@expo/ui';
Component
Type: React.Element<RNHostViewProps>
Hosts React Native views inside Jetpack Compose or SwiftUI views.
Props for the RNHostView component.
booleanWhether the component is disabled. Disabled components do not respond to user interaction.
boolean • Default: falseWhen true, the host updates its size in the native view tree to match
the children's size. When false, the host uses the size of the parent
native view.
Can only be set once on mount; changing it remounts the component.
ModifierConfig[]Platform-specific modifier escape hatch. Pass an array of modifier configs
from @expo/ui/swift-ui/modifiers or @expo/ui/jetpack-compose/modifiers.
A modifier supplied here replaces any modifier of the same type that the
component derives from style or other props.
() => voidCalled when the component is removed from screen.
(event: LayoutChangeEvent) => voidPick<ViewStyle, 'padding' | 'paddingHorizontal' | 'paddingVertical' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'backgroundColor' | 'borderRadius' | 'borderWidth' | 'borderColor' | 'opacity' | 'width' | 'height'>Platform-agnostic style properties. These are translated to SwiftUI modifiers on iOS and Jetpack Compose modifiers on Android.