SHARE
TWEET

React Native Text Input Exercise

arickanjass Dec 6th, 2018 (edited) 25 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import { StyleSheet, Text, View, TextInput } from 'react-native';
  3.  
  4. export default class App extends React.Component {
  5.   render() {
  6.     return (
  7.       <View style={styles.container}>
  8.         <Text>Username</Text>
  9.         <TextInput
  10.           style={styles.username}
  11.           placeholder="Username"
  12.         />
  13.         <Text>Password</Text>
  14.         <TextInput
  15.           style={styles.username}
  16.           placeholder="Password"
  17.         />
  18.       </View>
  19.     );
  20.   }
  21. }
  22.  
  23. const styles = StyleSheet.create({
  24.   container: {
  25.     flex: 1,
  26.     backgroundColor: '#7ed6df',
  27.     justifyContent: 'center',
  28.     padding: 10
  29.   },
  30.   username: {
  31.     width: '100%',
  32.     borderWidth: 1,
  33.     borderColor: 'black',
  34.     backgroundColor: '#fff',
  35.     padding: 5
  36.   }
  37. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top