Created
February 24, 2020 00:33
-
-
Save BrooklinJazz/0a0992028ab2f8813293d0e7699b35ca to your computer and use it in GitHub Desktop.
String as child of TouchableOpacity
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 {TouchableOpacity, Text} from "react-native"; | |
| // the following will fail because a string is not a valid child for the TouchableOpacity component. | |
| <TouchableOpacity>Start</TouchableOpacity> | |
| // You must wrap strings in a Text component in react native | |
| <TouchableOpacity><Text>Start</Text></TouchableOpacity> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment