Skip to main content

ReactChildView

Integrates a React Native View into Swift UI.

To display a react native view in SwiftUI, you must first pass it as an array to the property reactViews. To then display a view from this array in Swift UI, you must place a <RNSwiftUI.ReactChildView/>there and assign the index from the array to it. To do this, use the property index.

Preview

no preview available

Example Usage

 <RNSwiftUI.RootView
reactViews={[
<Text>Hello World</Text>,
<Button title="Trigger RNButton from Swift UI" onPress={() => alert()} />,
]}
>

<RNSwiftUI.ReactChildView index={0} />

<RNSwiftUI.RootView/>

Props

nametyperequireddescription
indexstringThe index of the react view

extends SwiftUIViewProperties