-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
40 lines (35 loc) · 777 Bytes
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React, {useState} from 'react';
import {
StyleSheet,
Text,
requireNativeComponent,
SafeAreaView,
} from 'react-native';
const SwiftUIButton = requireNativeComponent('SwiftUIButton');
const App = () => {
const [count, updateCount] = useState(0);
return (
<>
<SafeAreaView />
<Text style={styles.title}>React Native SwiftUI Proxy</Text>
<SwiftUIButton
style={styles.buttonContainer}
count={count}
onCountChange={e => updateCount(e.nativeEvent.count)}
/>
</>
);
};
const styles = StyleSheet.create({
title: {
fontSize: 30,
textAlign: 'center',
},
buttonContainer: {
marginTop: 100,
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
export default App;