Created
April 27, 2022 20:48
-
-
Save tanner-west/7da81734415e7d3382c636a9fadb072a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
SafeAreaView, | |
Text, | |
View, | |
TextInput, | |
} from 'react-native'; | |
const Name = () => { | |
const [name, setName] = useState(''); | |
return ( | |
<SafeAreaView> | |
<View style={{padding: 10}}> | |
{!name ? ( | |
<Text>Please type your name to get started</Text> | |
) : ( | |
<Text>{`Your name is: ${name}`}</Text> | |
)} | |
<TextInput | |
testID="name-input" | |
onChangeText={text => setName(text)} | |
style={{ | |
borderColor: 'black', | |
borderWidth: 1, | |
marginTop: 10, | |
padding: 5, | |
}} | |
/> | |
</View> | |
</SafeAreaView> | |
); | |
}; | |
export default Name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment