Using button created from SwiftUI in ReactNative

This commit is contained in:
Artur Gurgul 2025-08-03 10:01:13 +02:00
parent 97fb795866
commit 41081b5084
7 changed files with 52 additions and 1 deletions

View file

@ -11,6 +11,7 @@ type CustomButtonProps = {
style?: StyleProp<ViewStyle>
}
const CustomButton = requireNativeComponent<CustomButtonProps>('CustomButton')
const BaseButton = requireNativeComponent<CustomButtonProps>('BaseButton')
export default function App() {
const isDarkMode = useColorScheme() === 'dark'
@ -33,7 +34,8 @@ export default function App() {
<View style={styles.container}>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<Text>{message ?? 'Waiting for message...'}</Text>
<CustomButton style={{ width: 200, height: 200 }} />
<CustomButton style={{ height: 200 }} />
<BaseButton style={{ height: 200 }} />
<NewAppScreen templateFileName="App.tsx" />
</View>
);