33
loading...
This website collects cookies to deliver better user experience
import React from 'react';
import { Text } from 'react-native';
const Example = () => {
return (
<Text style={[ color: 'red' ]}>Example text in React Native!</Text>
);
}
export default Example;
React
library and any React Native component they want to use; in this example, the React Native component used to display text is Text
.Example
function returns a line of text with some basic styling applied to it to make the text red, and the Text
tags markup is embedded into the JavaScript Example
function. This styling is JavaScript, not CSS.export default
allows you to use the components anywhere.<template>
<text class="text-color">Example text in Vue Native!</text>
</template>
<style>
.text-color {
color: red;
}
</style>
<script>
</script>
template
tags, similar to the html
tags in web development.text
tags represent the component Vue Native uses for displaying text. By assigning a class named text-color
to it, you can apply CSS styling to the text using the class name within the style
tags.script
tags to manipulate your markup and data in your app.