L
L
letMeDie2019-09-07 20:56:27
React Native
letMeDie, 2019-09-07 20:56:27

What the hell is with the button in React Native?

I decided to try React Native, I already wanted a button to do everything well, but here.

Invariant Violation: Text strings must be rendered within a <Text> component.
- node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js:4029:4 in createTextInstance
- node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js:14495:12 in completeWork
- ... 19 more stack frames from framework internals

And I don't understand what's what, please explain.
Code but nothing special

<View style={styles.container}>
            <Text style={styles.header}>HE LO</Text>
            <View>
                <Button onPress={() => alert('You tapped the button!')} title="Click"/>
            </View>
</View>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shane Matte, 2020-05-12
@letMeDie

https://reactnative.dev/docs/touchableopacity

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question