diff --git a/android/src/main/java/com/pillarbox/PillarboxPackage.kt b/android/src/main/java/com/pillarbox/PillarboxPackage.kt index 02c57f2..6d9d51a 100644 --- a/android/src/main/java/com/pillarbox/PillarboxPackage.kt +++ b/android/src/main/java/com/pillarbox/PillarboxPackage.kt @@ -8,8 +8,6 @@ import com.facebook.react.module.model.ReactModuleInfo import com.facebook.react.module.model.ReactModuleInfoProvider import com.facebook.react.uimanager.ReactShadowNode import com.facebook.react.uimanager.ViewManager -import java.util.Collections -import java.util.HashMap class PillarboxPackage : TurboReactPackage() { override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { @@ -21,7 +19,7 @@ class PillarboxPackage : TurboReactPackage() { } override fun createViewManagers(reactContext: ReactApplicationContext): MutableList>> { - return mutableListOf(PillarboxViewManager()) + return super.createViewManagers(reactContext).toMutableList().apply { add(PillarboxViewManager()) } } override fun getReactModuleInfoProvider(): ReactModuleInfoProvider { diff --git a/example/src/App.tsx b/example/src/App.tsx index 49e4a22..a3dba81 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,14 +1,22 @@ import * as React from 'react'; +import {requireNativeComponent} from 'react-native'; -import { StyleSheet, View, Text } from 'react-native'; -import { multiply } from 'react-native-pillarbox'; +/** + * Composes `View`. + * + * - src: string + * - borderRadius: number + * - resizeMode: 'cover' | 'contain' | 'stretch' + */ +module.exports = requireNativeComponent('PillarboxReactView'); -const result = multiply(3, 7); +import { StyleSheet, View, Text } from 'react-native'; export default function App() { return ( + - Result: {result} + ); } diff --git a/example/src/PillarboxView.tsx b/example/src/PillarboxView.tsx new file mode 100644 index 0000000..f3889b5 --- /dev/null +++ b/example/src/PillarboxView.tsx @@ -0,0 +1,10 @@ +import {requireNativeComponent} from 'react-native'; + +/** + * Composes `View`. + * + * - src: string + * - borderRadius: number + * - resizeMode: 'cover' | 'contain' | 'stretch' + */ +module.exports = requireNativeComponent('PillarboxReactView');