Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement