-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
enhancementRequires extension or creation of new React Native APIRequires extension or creation of new React Native API
Description
Is there an existing request?
- I have searched for this request
Describe the feature request
Currently there is a logic in the Text component to decide what html component to be rendered.
So it can render div, span, a.
On a website a text can have role title, subtitle, paragraph etc.
Idea: Extend TextProps so include a new property preferredHTMLElement. Then if the Text will be used as title on a page it can get H1, H2 etc. That could help to boost SEO.
Alternative solution: use data attribute, e.g data-html-element (CON: can't limit the possible values)
Usage example:
<View>
<Text preferredHTMLElement="h1">I am the title</Text>
<Text preferredHTMLElement="h2">I am the sub-title</Text>
<Text preferredHTMLElement="p">I am just a paragraph</Text>
</View>
Metadata
Metadata
Assignees
Labels
enhancementRequires extension or creation of new React Native APIRequires extension or creation of new React Native API