SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // src/Components/User.js
  2.  
  3. import React, { useContext } from 'react';
  4. import { Text, TextInput, View } from 'react-native';
  5.  
  6. import Context from '../Store/Context';
  7.  
  8. const User = () => {
  9.   const { user, setUserName } = useContext(Context);
  10.  
  11.   return (
  12.     <View>
  13.       <Text style={{ fontSize: 35, marginTop: 20 }}>
  14.         User:{user.name}
  15.       </Text>
  16.       <TextInput
  17.         style={{ height: 40, borderColor: 'gray', borderWidth: 1 }}
  18.         onChangeText={text => setUserName(text)}
  19.         value={user.name}
  20.       />
  21.     </View>
  22.   );
  23. };
  24.  
  25. export default User;
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
 
Top