-
-
Save karanjagota/d42e9bfa596c77f983a3464b600df0af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import { StyleSheet, TextInput,Text, View } from 'react-native'; | |
export default function App() { | |
const [name, setName] = useState(''); | |
return ( | |
<View style = {styles.viewstyle}> | |
<TextInput | |
style={{height: 40, padding:20,margin:15}} | |
placeholder="Type Anything! " | |
onChangeText={name => setName(name)} | |
/> | |
<Text style={styles.textstyle}>{name}</Text> | |
</View> | |
); | |
} | |
const styles = StyleSheet.create({ | |
viewstyle:{flex:1,margin:10 }, | |
textstyle: { | |
fontSize:18, | |
backgroundColor: '#f50057', | |
marginBottom: 10, | |
color:'#ffffff', | |
padding:10, | |
textAlign: 'center', | |
borderRadius:20}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment