concept text element in category react native

appears as: text elements, text element, text elements
React Native in Action

This is an excerpt from Manning's book React Native in Action.

At the top of the file, you require React from 'react', as well as View, Text, and StyleSheet from 'react-native'. View is the most fundamental building block for creating React Native components and the UI in general and can be thought of like a div in HTML. Text allows you to create text elements and is comparable to a span tag in HTML. StyleSheet lets you create style objects to use in an application. These two packages (react and react-native) are available as npm modules.

With the exception of flex properties, which we have yet to cover, most of the styles applicable to View elements will also work as expected with Text elements. Text elements can have borders and backgrounds and are affected by layout properties like margin, padding, and position.

The reverse can’t be said. Most of the styles Text elements can use won’t work for View elements, which makes perfect sense. If you’ve ever used a word processor, you know you can use different fonts for text and change the font color; that you can resize, bold, and italicize the text; and that you can apply decorations like underlines.