Skip to content

Instantly share code, notes, and snippets.

@karanjagota
Last active October 23, 2020 18:27
Show Gist options
  • Save karanjagota/d42e9bfa596c77f983a3464b600df0af to your computer and use it in GitHub Desktop.
Save karanjagota/d42e9bfa596c77f983a3464b600df0af to your computer and use it in GitHub Desktop.
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