()
| 2 | import { StyleSheet, Text, View, Button, TextInput } from 'react-native'; |
| 3 | |
| 4 | export default function App() { |
| 5 | const [enteredGoalText, setEnteredGoalText] = useState(''); |
| 6 | |
| 7 | function goalInputHandler(enteredText) { |
| 8 | setEnteredGoalText(enteredText); |
| 9 | } |
| 10 | |
| 11 | function addGoalHandler() { |
| 12 | console.log(enteredGoalText); |
| 13 | } |
| 14 | |
| 15 | return ( |
| 16 | <View style={styles.appContainer}> |
| 17 | <View style={styles.inputContainer}> |
| 18 | <TextInput |
| 19 | style={styles.textInput} |
| 20 | placeholder="Your course goal!" |
| 21 | onChangeText={goalInputHandler} |
| 22 | /> |
| 23 | <Button title="Add Goal" onPress={addGoalHandler} /> |
| 24 | </View> |
| 25 | <View style={styles.goalsContainer}> |
| 26 | <Text>List of goals...</Text> |
| 27 | </View> |
| 28 | </View> |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | const styles = StyleSheet.create({ |
| 33 | appContainer: { |
nothing calls this directly
no outgoing calls
no test coverage detected