Compare the differences between HTML elements and native components

Source: Internet
Author: User

We develop Web applications that use a variety of basic HTML elements, compare <div>,<span>, and more.

When we develop react native, we can't use HTML elements, but we can use a variety of components like

Html React Native
Div View
Img Image
Span,p Text

Although these elements have many similar uses, they are not equivalent. Let's get down to how these components run on the mobile side,

1. Text Components

Rendering text appears to be a basic feature that almost any application needs to render text. However, it is different from the normal text rendering of the web.

In react native, only the <Text> component can be a child of plain text, in other words, this is not valid:

< View > The text cannot be placed here </ View >

Instead, use the <Text> component to wrap the text content:

< View > < Text ></ Text > </ View >

Compare the differences between HTML elements and native components

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.