-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
35 lines (31 loc) · 913 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
import React, {useState} from 'react';
import {SafeAreaView, StyleSheet, Text} from 'react-native';
import PhoneInputRn from 'input-phone-rn-br';
const App = () => {
const [value, setValue] = useState<string>('');
const [phoneFormated, setPhoneFormated] = useState<string>('');
return (
<SafeAreaView style={styles.container}>
<Text style={styles.text}>Phone Input React Native</Text>
<PhoneInputRn
value={value}
onChangeText={(text) => setValue(text)}
setPhoneFormated={setPhoneFormated}
cellFormat
/>
<Text style={{fontSize: 20}}>Phone Formated: {phoneFormated}</Text>
<Text style={{fontSize: 20}}>Phone Value: {value}</Text>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
text: {
fontSize: 30,
},
});
export default App;