React Native – Text

Text is used for displaying text. It supports styling, nesting, and touch handling.

Use Cases:

  • Displaying static text.
  • Styling different parts of text differently using nested Text components.
  • Handling text touch events.

Example:

import React from 'react';
import { Text, StyleSheet } from 'react-native';

const App = () => {
  return (
    <Text style={styles.text}>Hello, Text!</Text>
  );
};

const styles = StyleSheet.create({
  text: {
    fontSize: 20,
    color: 'blue',
    textAlign: 'center',
    marginTop: 50,
  },
});

export default App;

Tutorials Deck

TutorialsDeck is striving to provide the best learning material on technical and non-technical subjects.

Languages

Web Technologies

Database

Trending Technologies

© 2024. All rights reserved.

Contact Us @ tutorialsdeck06@gmail.com