mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
49 lines
76 KiB
HTML
49 lines
76 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<meta name="generator" content="Docusaurus v2.0.0-alpha.66">
|
|
<link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="React Native Blog RSS Feed">
|
|
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="React Native Blog Atom Feed">
|
|
<link rel="preconnect" href="https://www.google-analytics.com">
|
|
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-41298772-2","auto"),ga("send","pageview")</script>
|
|
<script async src="https://www.google-analytics.com/analytics.js"></script>
|
|
<link rel="preconnect" href="https://www.google-analytics.com">
|
|
<link rel="preconnect" href="https://www.googletagmanager.com">
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-41298772-2"></script>
|
|
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-41298772-2",{})</script>
|
|
<link rel="search" type="application/opensearchdescription+xml" title="React Native" href="/opensearch.xml">
|
|
<script src="https://cdn.jsdelivr.net/npm/focus-visible@5.2.0/dist/focus-visible.min.js" defer="defer"></script>
|
|
<script src="https://snack.expo.io/embed.js" defer="defer"></script><title data-react-helmet="true">Text · React Native</title><meta data-react-helmet="true" property="twitter:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" name="twitter:image:alt" content="Image for React Native"><meta data-react-helmet="true" name="docsearch:language" content="en"><meta data-react-helmet="true" name="docsearch:version" content="0.63"><meta data-react-helmet="true" name="docsearch:docusaurus_tag" content="docs-default-0.63"><meta data-react-helmet="true" property="og:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" name="twitter:card" content="summary"><meta data-react-helmet="true" name="twitter:image" content="https://reactnative.dev/img/logo-og.png"><meta data-react-helmet="true" property="og:title" content="Text · React Native"><meta data-react-helmet="true" name="description" content="A React component for displaying text."><meta data-react-helmet="true" property="og:description" content="A React component for displaying text."><meta data-react-helmet="true" property="og:url" content="https://reactnative.dev/docs/text"><link data-react-helmet="true" rel="shortcut icon" href="/img/favicon.ico"><link data-react-helmet="true" rel="preconnect" href="https://BH4D9OD16A-dsn.algolia.net" crossorigin="anonymous"><link data-react-helmet="true" rel="canonical" href="https://reactnative.dev/docs/text"><link rel="stylesheet" href="/styles.fccefeba.css">
|
|
<link rel="stylesheet" href="/main.ed4acc82.css">
|
|
<link rel="preload" href="/styles.25dfd8ab.js" as="script">
|
|
<link rel="preload" href="/runtime~main.708a3503.js" as="script">
|
|
<link rel="preload" href="/main.00cf4c49.js" as="script">
|
|
<link rel="preload" href="/1.844dff91.js" as="script">
|
|
<link rel="preload" href="/2.e0509fa8.js" as="script">
|
|
<link rel="preload" href="/1f391b9e.3f65ce9d.js" as="script">
|
|
<link rel="preload" href="/941.a6bd671c.js" as="script">
|
|
<link rel="preload" href="/ee5b3385.8c48d415.js" as="script">
|
|
<link rel="preload" href="/17896441.8ef96896.js" as="script">
|
|
<link rel="preload" href="/b0c8f754.2b2dbfd3.js" as="script">
|
|
</head>
|
|
<body>
|
|
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
|
|
<nav class="navbar navbar--fixed-top navbar--dark"><div class="navbar__inner"><div class="navbar__items"><div aria-label="Navigation bar toggle" class="navbar__toggle" role="button" tabindex="0"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></div><a class="navbar__brand" href="/"><img class="navbar__logo" src="/img/header_logo.svg" alt="React Native"><strong class="navbar__title">React Native</strong></a><div class="navbar__item dropdown dropdown--hoverable dropdown--left"><a class="navbar__item navbar__link" href="/docs/getting-started">0.63</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/docs/next/text">Next</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/docs/text">0.63</a></li><li><a class="dropdown__link" href="/docs/0.62/text">0.62</a></li><li><a class="dropdown__link" href="/docs/0.61/text">0.61</a></li><li><a class="dropdown__link" href="/docs/0.60/text">0.60</a></li><li><a class="dropdown__link" href="/versions">All versions</a></li></ul></div></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/docs/getting-started">Docs</a><a class="navbar__item navbar__link navbar__link--active" href="/docs/components-and-apis">Components</a><a class="navbar__item navbar__link" href="/docs/accessibilityinfo">API</a><a class="navbar__item navbar__link" href="/help">Community</a><a class="navbar__item navbar__link" href="/blog">Blog</a><a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link navbar-github-link" aria-label="GitHub repository"></a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_3lWe"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_gnXW">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_gnXW">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span><span class="DocSearch-Button-Key">⌘</span><span class="DocSearch-Button-Key">K</span></button></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/"><img class="navbar__logo" src="/img/header_logo.svg" alt="React Native"><strong class="navbar__title">React Native</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/docs/getting-started">Docs</a></li><li class="menu__list-item"><a class="menu__link navbar__link--active" href="/docs/components-and-apis">Components</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/accessibilityinfo">API</a></li><li class="menu__list-item"><a class="menu__link" href="/help">Community</a></li><li class="menu__list-item"><a class="menu__link" href="/blog">Blog</a></li><li class="menu__list-item"><a role="button" class="menu__link menu__link--sublist">Versions</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/docs/next/text">Next</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active" href="/docs/text">0.63</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.62/text">0.62</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.61/text">0.61</a></li><li class="menu__list-item"><a class="menu__link" href="/docs/0.60/text">0.60</a></li><li class="menu__list-item"><a class="menu__link" href="/versions">All versions</a></li></ul></li><li class="menu__list-item"><a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="menu__link navbar-github-link" aria-label="GitHub repository"></a></li></ul></div></div></div></nav><div class="main-wrapper"><div class="docPage_2UBv"><div class="docSidebarContainer_1hqR" role="complementary"><div class="sidebar_MSwm"><div class="menu menu--responsive menu_2hiu"><button aria-label="Open Menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_37TU" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 32 32" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">Core Components</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/components-and-apis">Core Components and APIs</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/activityindicator">ActivityIndicator</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/button">Button</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/flatlist">FlatList</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/image">Image</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/imagebackground">ImageBackground</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/keyboardavoidingview">KeyboardAvoidingView</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modal">Modal</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/pressable">Pressable</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/refreshcontrol">RefreshControl</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/scrollview">ScrollView</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/sectionlist">SectionList</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/statusbar">StatusBar</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/switch">Switch</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/docs/text">Text</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/textinput">TextInput</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/touchablehighlight">TouchableHighlight</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/touchableopacity">TouchableOpacity</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/touchablewithoutfeedback">TouchableWithoutFeedback</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/view">View</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/virtualizedlist">VirtualizedList</a></li><li class="menu__list-item"><a class="menu__link menu__link--sublist" href="#!" tabindex="0">Android Components</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/drawerlayoutandroid">DrawerLayoutAndroid</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/touchablenativefeedback">TouchableNativeFeedback</a></li></ul></li><li class="menu__list-item"><a class="menu__link menu__link--sublist" href="#!" tabindex="0">iOS Components</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/inputaccessoryview">InputAccessoryView</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/maskedviewios">🚧 MaskedViewIOS</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/safeareaview">SafeAreaView</a></li></ul></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Props</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/image-style-props">Image Style Props</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/layout-props">Layout Props</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/shadow-props">Shadow Props</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/text-style-props">Text Style Props</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/view-style-props">View Style Props</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Object Types</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/pressevent">PressEvent Object Type</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/react-node">React Node Object Type</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/rect">Rect Object Type</a></li></ul></li></ul></div></div></div><main class="docMainContainer_1rYT"><div class="container padding-vert--lg docItemWrapper_1Hme"><div class="row"><div class="col docItemCol_2AGf"><div class="docItemContainer_1tAC"><article><header><h1 class="docTitle_cWlf">Text</h1></header><div class="markdown"><p>A React component for displaying text.</p><p><code>Text</code> supports nesting, styling, and touch handling.</p><p>In the following example, the nested title and body text will inherit the <code>fontFamily</code> from <code>styles.baseText</code>, but the title provides its own additional styles. The title and body will stack on top of each other on account of the literal newlines:</p><div><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_3gSF tabs__item--active" style="outline:none">Function Component</li><li role="tab" tabindex="0" aria-selected="false" class="tabs__item tabItem_3gSF" style="outline:none">Class Component</li></ul><div role="tabpanel" class="margin-vert--md"><div><div class="snack-player" data-snack-name="Text Functional Component Example" data-snack-description="Example usage" data-snack-code="import%20React%2C%20%7B%20useState%20%7D%20from%20%22react%22%3B%0Aimport%20%7B%20Text%2C%20StyleSheet%20%7D%20from%20%22react-native%22%3B%0A%0Aconst%20onPressTitle%20%3D%20()%20%3D%3E%20%7B%0A%20%20console.log(%22title%20pressed%22)%3B%0A%7D%3B%0A%0Aconst%20TextInANest%20%3D%20()%20%3D%3E%20%7B%0A%20%20const%20titleText%20%3D%20useState(%22Bird's%20Nest%22)%3B%0A%20%20const%20bodyText%20%3D%20useState(%22This%20is%20not%20really%20a%20bird%20nest.%22)%3B%0A%0A%20%20return%20(%0A%20%20%20%20%3CText%20style%3D%7Bstyles.baseText%7D%3E%0A%20%20%20%20%20%20%3CText%20style%3D%7Bstyles.titleText%7D%20onPress%3D%7BonPressTitle%7D%3E%0A%20%20%20%20%20%20%20%20%7BtitleText%7D%0A%20%20%20%20%20%20%20%20%7B%22%5Cn%22%7D%0A%20%20%20%20%20%20%20%20%7B%22%5Cn%22%7D%0A%20%20%20%20%20%20%3C%2FText%3E%0A%20%20%20%20%20%20%3CText%20numberOfLines%3D%7B5%7D%3E%7BbodyText%7D%3C%2FText%3E%0A%20%20%20%20%3C%2FText%3E%0A%20%20)%3B%0A%7D%3B%0A%0Aconst%20styles%20%3D%20StyleSheet.create(%7B%0A%20%20baseText%3A%20%7B%0A%20%20%20%20fontFamily%3A%20%22Cochin%22%0A%20%20%7D%2C%0A%20%20titleText%3A%20%7B%0A%20%20%20%20fontSize%3A%2020%2C%0A%20%20%20%20fontWeight%3A%20%22bold%22%0A%20%20%7D%0A%7D)%3B%0A%0Aexport%20default%20TextInANest%3B%0A" data-snack-platform="web" data-snack-supported-platforms="ios,android,web" data-snack-theme="light" data-snack-preview="true" data-snack-loading="lazy"></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="nested-text"></a>Nested text<a aria-hidden="true" tabindex="-1" class="hash-link" href="#nested-text" title="Direct link to heading">#</a></h2><p>Both Android and iOS allow you to display formatted text by annotating ranges of a string with specific formatting like bold or colored text (<code>NSAttributedString</code> on iOS, <code>SpannableString</code> on Android). In practice, this is very tedious. For React Native, we decided to use web paradigm for this where you can nest text to achieve the same effect.</p><div class="snack-player" data-snack-name="Nested Text Example" data-snack-description="Example usage" data-snack-code="import%20React%20from%20'react'%3B%0Aimport%20%7B%20Text%2C%20StyleSheet%20%7D%20from%20'react-native'%3B%0A%0Aconst%20BoldAndBeautiful%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CText%20style%3D%7Bstyles.baseText%7D%3E%0A%20%20%20%20%20%20I%20am%20bold%0A%20%20%20%20%20%20%3CText%20style%3D%7Bstyles.innerText%7D%3E%20and%20red%3C%2FText%3E%0A%20%20%20%20%3C%2FText%3E%0A%20%20)%3B%0A%7D%3B%0A%0Aconst%20styles%20%3D%20StyleSheet.create(%7B%0A%20%20baseText%3A%20%7B%0A%20%20%20%20fontWeight%3A%20'bold'%0A%20%20%7D%2C%0A%20%20innerText%3A%20%7B%0A%20%20%20%20color%3A%20'red'%0A%20%20%7D%0A%7D)%3B%0A%0Aexport%20default%20BoldAndBeautiful%3B" data-snack-platform="web" data-snack-supported-platforms="ios,android,web" data-snack-theme="light" data-snack-preview="true" data-snack-loading="lazy"></div><p>Behind the scenes, React Native converts this to a flat <code>NSAttributedString</code> or <code>SpannableString</code> that contains the following information:</p><div class="mdxCodeBlock_xYIz"><div class="codeBlockContent_rlEb"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_kOW4">Copy</button><div class="prism-code language-jsx codeBlock_1AP7"><div class="codeBlockLines_1boI" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token string" style="color:#8dc891">"I am bold and red"</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token number" style="color:#5a9bcf">0</span><span class="token operator" style="color:#fc929e">-</span><span class="token number" style="color:#5a9bcf">9</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> bold</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token number" style="color:#5a9bcf">9</span><span class="token operator" style="color:#fc929e">-</span><span class="token number" style="color:#5a9bcf">17</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> bold</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> red</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="containers"></a>Containers<a aria-hidden="true" tabindex="-1" class="hash-link" href="#containers" title="Direct link to heading">#</a></h2><p>The <code><Text></code> element is unique relative to layout: everything inside is no longer using the Flexbox layout but using text layout. This means that elements inside of a <code><Text></code> are no longer rectangles, but wrap when they see the end of the line.</p><div class="mdxCodeBlock_xYIz"><div class="codeBlockContent_rlEb"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_kOW4">Copy</button><div class="prism-code language-jsx codeBlock_1AP7"><div class="codeBlockLines_1boI" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain">First part and </span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain">second part</span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// Text container: the text will be inline if the space allowed it</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |First part and second part|</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain" style="display:inline-block">
|
|
</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// otherwise, the text will flow as if it was one</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |First part |</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |and second |</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |part |</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain" style="display:inline-block">
|
|
</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">View</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain">First part and </span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain">second part</span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">View</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// View container: each text is its own block</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |First part and|</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |second part |</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain" style="display:inline-block">
|
|
</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// otherwise, the text will flow in its own block</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |First part |</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |and |</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// |second part|</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="limited-style-inheritance"></a>Limited Style Inheritance<a aria-hidden="true" tabindex="-1" class="hash-link" href="#limited-style-inheritance" title="Direct link to heading">#</a></h2><p>On the web, the usual way to set a font family and size for the entire document is to take advantage of inherited CSS properties like so:</p><div class="mdxCodeBlock_xYIz"><div class="codeBlockContent_rlEb"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_kOW4">Copy</button><div class="prism-code language-css codeBlock_1AP7"><div class="codeBlockLines_1boI" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token selector" style="color:#2aa198">html</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token property" style="color:#2aa198">font-family</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token string" style="color:#8dc891">'lucida grande'</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> tahoma</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> verdana</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> arial</span><span class="token punctuation" style="color:#657b83">,</span><span class="token plain"> sans-serif</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token property" style="color:#2aa198">font-size</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token number" style="color:#5a9bcf">11</span><span class="token unit">px</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token property" style="color:#2aa198">color</span><span class="token punctuation" style="color:#657b83">:</span><span class="token plain"> </span><span class="token hexcode">#141823</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span></div></div></div></div></div><p>All elements in the document will inherit this font unless they or one of their parents specifies a new rule.</p><p>In React Native, we are more strict about it: <strong>you must wrap all the text nodes inside of a <code><Text></code> component</strong>. You cannot have a text node directly under a <code><View></code>.</p><div class="mdxCodeBlock_xYIz"><div class="codeBlockContent_rlEb"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_kOW4">Copy</button><div class="prism-code language-jsx codeBlock_1AP7"><div class="codeBlockLines_1boI" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token comment" style="color:#93a1a1">// BAD: will raise exception, can't have a text node as child of a <View></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">View</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> Some text</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">View</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain" style="display:inline-block">
|
|
</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token comment" style="color:#93a1a1">// GOOD</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">View</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> Some text</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">View</span><span class="token tag punctuation" style="color:#657b83">></span></div></div></div></div></div><p>You also lose the ability to set up a default font for an entire subtree. Meanwhile, <code>fontFamily</code> only accepts a single font name, which is different from <code>font-family</code> in CSS. The recommended way to use consistent fonts and sizes across your application is to create a component <code>MyAppText</code> that includes them and use this component across your app. You can also use this component to make more specific components like <code>MyAppHeaderText</code> for other kinds of text.</p><div class="mdxCodeBlock_xYIz"><div class="codeBlockContent_rlEb"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_kOW4">Copy</button><div class="prism-code language-jsx codeBlock_1AP7"><div class="codeBlockLines_1boI" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">View</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">MyAppText</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> Text styled </span><span class="token keyword" style="color:#c5a5c5">with</span><span class="token plain"> the </span><span class="token keyword" style="color:#c5a5c5">default</span><span class="token plain"> font </span><span class="token keyword" style="color:#c5a5c5">for</span><span class="token plain"> the entire application</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">MyAppText</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">MyAppHeaderText</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain">Text styled </span><span class="token keyword" style="color:#c5a5c5">as</span><span class="token plain"> a header</span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">MyAppHeaderText</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">View</span><span class="token tag punctuation" style="color:#657b83">></span></div></div></div></div></div><p>Assuming that <code>MyAppText</code> is a component that only renders out its children into a <code>Text</code> component with styling, then <code>MyAppHeaderText</code> can be defined as follows:</p><div class="mdxCodeBlock_xYIz"><div class="codeBlockContent_rlEb"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_kOW4">Copy</button><div class="prism-code language-jsx codeBlock_1AP7"><div class="codeBlockLines_1boI" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token keyword" style="color:#c5a5c5">class</span><span class="token plain"> </span><span class="token class-name" style="color:#fac863">MyAppHeaderText</span><span class="token plain"> </span><span class="token keyword" style="color:#c5a5c5">extends</span><span class="token plain"> </span><span class="token class-name" style="color:#fac863">Component</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token function" style="color:#79b6f2">render</span><span class="token punctuation" style="color:#657b83">(</span><span class="token punctuation" style="color:#657b83">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token keyword" style="color:#c5a5c5">return</span><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">(</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">MyAppText</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag" style="color:#fc929e"> </span><span class="token tag attr-name" style="color:#c5a5c5">style</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#657b83">=</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript" style="color:#fc929e"> fontSize</span><span class="token tag script language-javascript punctuation" style="color:#657b83">:</span><span class="token tag script language-javascript" style="color:#fc929e"> </span><span class="token tag script language-javascript number" style="color:#5a9bcf">20</span><span class="token tag script language-javascript" style="color:#fc929e"> </span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">{</span><span class="token keyword" style="color:#c5a5c5">this</span><span class="token punctuation" style="color:#657b83">.</span><span class="token plain">props</span><span class="token punctuation" style="color:#657b83">.</span><span class="token plain">children</span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">MyAppText</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">)</span><span class="token punctuation" style="color:#657b83">;</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token punctuation" style="color:#657b83">}</span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token punctuation" style="color:#657b83">}</span></div></div></div></div></div><p>Composing <code>MyAppText</code> in this way ensures that we get the styles from a top-level component, but leaves us the ability to add / override them in specific use cases.</p><p>React Native still has the concept of style inheritance, but limited to text subtrees. In this case, the second part will be both bold and red.</p><div class="mdxCodeBlock_xYIz"><div class="codeBlockContent_rlEb"><button tabindex="0" type="button" aria-label="Copy code to clipboard" class="copyButton_kOW4">Copy</button><div class="prism-code language-jsx codeBlock_1AP7"><div class="codeBlockLines_1boI" style="color:#FFFFFF;background:#282C34"><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag" style="color:#fc929e"> </span><span class="token tag attr-name" style="color:#c5a5c5">style</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#657b83">=</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript" style="color:#fc929e"> fontWeight</span><span class="token tag script language-javascript punctuation" style="color:#657b83">:</span><span class="token tag script language-javascript" style="color:#fc929e"> </span><span class="token tag script language-javascript string" style="color:#8dc891">'bold'</span><span class="token tag script language-javascript" style="color:#fc929e"> </span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token constant" style="color:#5a9bcf">I</span><span class="token plain"> am bold</span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"> </span><span class="token tag punctuation" style="color:#657b83"><</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag" style="color:#fc929e"> </span><span class="token tag attr-name" style="color:#c5a5c5">style</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:#657b83">=</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript punctuation" style="color:#657b83">{</span><span class="token tag script language-javascript" style="color:#fc929e"> color</span><span class="token tag script language-javascript punctuation" style="color:#657b83">:</span><span class="token tag script language-javascript" style="color:#fc929e"> </span><span class="token tag script language-javascript string" style="color:#8dc891">'red'</span><span class="token tag script language-javascript" style="color:#fc929e"> </span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag script language-javascript punctuation" style="color:#657b83">}</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain">and red</span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span><span class="token plain"></span></div><div class="token-line" style="color:#FFFFFF;background:#282C34"><span class="token plain"></span><span class="token tag punctuation" style="color:#657b83"></</span><span class="token tag class-name" style="color:#fac863">Text</span><span class="token tag punctuation" style="color:#657b83">></span></div></div></div></div></div><p>We believe that this more constrained way to style text will yield better apps:</p><ul><li><p>(Developer) React components are designed with strong isolation in mind: You should be able to drop a component anywhere in your application, trusting that as long as the props are the same, it will look and behave the same way. Text properties that could inherit from outside of the props would break this isolation.</p></li><li><p>(Implementor) The implementation of React Native is also simplified. We do not need to have a <code>fontFamily</code> field on every single element, and we do not need to potentially traverse the tree up to the root every time we display a text node. The style inheritance is only encoded inside of the native Text component and doesn't leak to other components or the system itself.</p></li></ul><hr><h1><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="reference"></a>Reference<a aria-hidden="true" tabindex="-1" class="hash-link" href="#reference" title="Direct link to heading">#</a></h1><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="props"></a>Props<a aria-hidden="true" tabindex="-1" class="hash-link" href="#props" title="Direct link to heading">#</a></h2><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="accessibilityhint"></a><code>accessibilityHint</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#accessibilityhint" title="Direct link to heading">#</a></h3><p>An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>string</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="accessibilitylabel"></a><code>accessibilityLabel</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#accessibilitylabel" title="Direct link to heading">#</a></h3><p>Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the <code>Text</code> nodes separated by space.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>string</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="accessibilityrole"></a><code>accessibilityRole</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#accessibilityrole" title="Direct link to heading">#</a></h3><p>Tells the screen reader to treat the currently focused on element as having a specific role.</p><p>Possible values for <code>AccessibilityRole</code> is one of:</p><ul><li><code>'none'</code> - The element has no role.</li><li><code>'button'</code> - The element should be treated as a button.</li><li><code>'link'</code> - The element should be treated as a link.</li><li><code>'header'</code> - The element is a header that divides content into sections.</li><li><code>'search'</code> - The element should be treated as a search field.</li><li><code>'image'</code> - The element should be treated as an image.</li><li><code>'key'</code> - The element should be treated like a keyboard key.</li><li><code>'text'</code> - The element should be treated as text.</li><li><code>'summary'</code> - The element provides app summary information.</li><li><code>'imagebutton'</code> - The element has the role of both an image and also a button.</li><li><code>'adjustable'</code> - The element allows adjustment over a range of values.</li></ul><p>On iOS, these roles map to corresponding Accessibility Traits. Image button has the same functionality as if the trait was set to both 'image' and 'button'. See the <a href="/docs/accessibility#accessibilitytraits-ios">Accessibility guide</a> for more information.</p><p>On Android, these roles have similar functionality on TalkBack as adding Accessibility Traits does on Voiceover in iOS</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>AccessibilityRole</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="accessibilitystate"></a><code>accessibilityState</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#accessibilitystate" title="Direct link to heading">#</a></h3><p>Tells the screen reader to treat the currently focused on element as being in a specific state.</p><p>You can provide one state, no state, or multiple states. The states must be passed in through an object. Ex: <code>{selected: true, disabled: true}</code>.</p><p>Possible values for <code>AccessibilityState</code> are:</p><ul><li><code>'selected'</code> - The element is in a selected state.</li><li><code>'disabled'</code> - The element is in a disabled state.</li></ul><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>object</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="accessible"></a><code>accessible</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#accessible" title="Direct link to heading">#</a></h3><p>When set to <code>true</code>, indicates that the view is an accessibility element. The default value for a <code>Text</code> element is <code>true</code>.</p><p>See the <a href="/docs/accessibility#accessible-ios-android">Accessibility guide</a> for more information.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="adjustsfontsizetofit"></a><code>adjustsFontSizeToFit</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#adjustsfontsizetofit" title="Direct link to heading">#</a></h3><p>Specifies whether fonts should be scaled down automatically to fit given style constraints.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="allowfontscaling"></a><code>allowFontScaling</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#allowfontscaling" title="Direct link to heading">#</a></h3><p>Specifies whether fonts should scale to respect Text Size accessibility settings. The default is <code>true</code>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="datadetectortype"></a><code>dataDetectorType</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#datadetectortype" title="Direct link to heading">#</a></h3><p>Determines the types of data converted to clickable URLs in the text element. By default no data types are detected.</p><p>You can provide only one type.</p><p>Possible values for <code>dataDetectorType</code> are:</p><ul><li><code>'phoneNumber'</code></li><li><code>'link'</code></li><li><code>'email'</code></li><li><code>'none'</code></li><li><code>'all'</code></li></ul><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>enum('phoneNumber', 'link', 'email', 'none', 'all')</td><td>No</td><td>Android</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="disabled"></a><code>disabled</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#disabled" title="Direct link to heading">#</a></h3><p>Specifies the disabled state of the text view for testing purposes</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>Android</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="ellipsizemode"></a><code>ellipsizeMode</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#ellipsizemode" title="Direct link to heading">#</a></h3><p>When <code>numberOfLines</code> is set, this prop defines how text will be truncated. <code>numberOfLines</code> must be set in conjunction with this prop.</p><p>This can be one of the following values:</p><ul><li><code>head</code> - The line is displayed so that the end fits in the container and the missing text at the beginning of the line is indicated by an ellipsis glyph. e.g., "...wxyz"</li><li><code>middle</code> - The line is displayed so that the beginning and end fit in the container and the missing text in the middle is indicated by an ellipsis glyph. "ab...yz"</li><li><code>tail</code> - The line is displayed so that the beginning fits in the container and the missing text at the end of the line is indicated by an ellipsis glyph. e.g., "abcd..."</li><li><code>clip</code> - Lines are not drawn past the edge of the text container.</li></ul><p>The default is <code>tail</code>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>enum('head', 'middle', 'tail', 'clip')</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="maxfontsizemultiplier"></a><code>maxFontSizeMultiplier</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#maxfontsizemultiplier" title="Direct link to heading">#</a></h3><p>Specifies largest possible scale a font can reach when <code>allowFontScaling</code> is enabled. Possible values:</p><ul><li><code>null/undefined</code> (default): inherit from the parent node or the global default (0)</li><li><code>0</code>: no max, ignore parent/global default</li><li><code>>= 1</code>: sets the <code>maxFontSizeMultiplier</code> of this node to this value</li></ul><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>number</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="minimumfontscale"></a><code>minimumFontScale</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#minimumfontscale" title="Direct link to heading">#</a></h3><p>Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>number</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="nativeid"></a><code>nativeID</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#nativeid" title="Direct link to heading">#</a></h3><p>Used to locate this view from native code.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>string</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="numberoflines"></a><code>numberOfLines</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#numberoflines" title="Direct link to heading">#</a></h3><p>Used to truncate the text with an ellipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number.</p><p>This prop is commonly used with <code>ellipsizeMode</code>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>number</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onlayout"></a><code>onLayout</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onlayout" title="Direct link to heading">#</a></h3><p>Invoked on mount and layout changes with</p><p><code>{nativeEvent: {layout: {x, y, width, height}}}</code></p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onlongpress"></a><code>onLongPress</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onlongpress" title="Direct link to heading">#</a></h3><p>This function is called on long press.</p><p>e.g., <code>onLongPress={this.increaseSize}></code></p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onmoveshouldsetresponder"></a><code>onMoveShouldSetResponder</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onmoveshouldsetresponder" title="Direct link to heading">#</a></h3><p>Does this view want to "claim" touch responsiveness? This is called for every touch move on the <code>View</code> when it is not the responder.</p><p><code>View.props.onMoveShouldSetResponder: (event) => [true | false]</code>, where <code>event</code> is a <a href="/docs/pressevent">PressEvent</a>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onpress"></a><code>onPress</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onpress" title="Direct link to heading">#</a></h3><p>This function is called on press. The first function argument is an event in form of <a href="/docs/pressevent">PressEvent</a>.</p><p>e.g., <code>onPress={() => console.log('1st')}</code></p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onrespondergrant"></a><code>onResponderGrant</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onrespondergrant" title="Direct link to heading">#</a></h3><p>The View is now responding for touch events. This is the time to highlight and show the user what is happening.</p><p><code>View.props.onResponderGrant: (event) => {}</code>, where <code>event</code> is a <a href="/docs/pressevent">PressEvent</a>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onrespondermove"></a><code>onResponderMove</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onrespondermove" title="Direct link to heading">#</a></h3><p>The user is moving their finger.</p><p><code>View.props.onResponderMove: (event) => {}</code>, where <code>event</code> is a <a href="/docs/pressevent">PressEvent</a>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onresponderrelease"></a><code>onResponderRelease</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onresponderrelease" title="Direct link to heading">#</a></h3><p>Fired at the end of the touch.</p><p><code>View.props.onResponderRelease: (event) => {}</code>, where <code>event</code> is a <a href="/docs/pressevent">PressEvent</a>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onresponderterminate"></a><code>onResponderTerminate</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onresponderterminate" title="Direct link to heading">#</a></h3><p>The responder has been taken from the <code>View</code>. Might be taken by other views after a call to <code>onResponderTerminationRequest</code>, or might be taken by the OS without asking (e.g., happens with control center/ notification center on iOS)</p><p><code>View.props.onResponderTerminate: (event) => {}</code>, where <code>event</code> is a <a href="/docs/pressevent">PressEvent</a>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onresponderterminationrequest"></a><code>onResponderTerminationRequest</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onresponderterminationrequest" title="Direct link to heading">#</a></h3><p>Some other <code>View</code> wants to become responder and is asking this <code>View</code> to release its responder. Returning <code>true</code> allows its release.</p><p><code>View.props.onResponderTerminationRequest: (event) => {}</code>, where <code>event</code> is a <a href="/docs/pressevent">PressEvent</a>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="onstartshouldsetrespondercapture"></a><code>onStartShouldSetResponderCapture</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#onstartshouldsetrespondercapture" title="Direct link to heading">#</a></h3><p>If a parent <code>View</code> wants to prevent a child <code>View</code> from becoming responder on a touch start, it should have this handler which returns <code>true</code>.</p><p><code>View.props.onStartShouldSetResponderCapture: (event) => [true | false]</code>, where <code>event</code> is a <a href="/docs/pressevent">PressEvent</a>.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="ontextlayout"></a><code>onTextLayout</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#ontextlayout" title="Direct link to heading">#</a></h3><p>Invoked on Text layout</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>function: (event: TextLayoutEvent) => mixed</td><td>No</td></tr></tbody></table><ul><li>TextLayoutEvent - SyntheticEvent object that contains a key called <code>lines</code> with a value which is an array containing objects with the following properties<ul><li>{ x: number, y: number, width: number, height: number, ascender: number, capHeight: number, descender: number, text: string, xHeight: number,}</li></ul></li></ul><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="pressretentionoffset"></a><code>pressRetentionOffset</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#pressretentionoffset" title="Direct link to heading">#</a></h3><p>When the scroll view is disabled, this defines how far your touch may move off of the button, before deactivating the button. Once deactivated, try moving it back and you'll see that the button is once again reactivated! Move it back and forth several times while the scroll view is disabled. Ensure you pass in a constant to reduce memory allocations.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td><a href="/docs/rect">Rect</a> or number</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="selectable"></a><code>selectable</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#selectable" title="Direct link to heading">#</a></h3><p>Lets the user select text, to use the native copy and paste functionality.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>bool</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="selectioncolor"></a><code>selectionColor</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#selectioncolor" title="Direct link to heading">#</a></h3><p>The highlight color of the text.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td><a href="/docs/colors">color</a></td><td>No</td><td>Android</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="style"></a><code>style</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#style" title="Direct link to heading">#</a></h3><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td><a href="/docs/text-style-props">Text Style Props</a>, <a href="/docs/view-style-props">View Style Props</a></td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="suppresshighlighting"></a><code>suppressHighlighting</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#suppresshighlighting" title="Direct link to heading">#</a></h3><p>When <code>true</code>, no visual change is made when text is pressed down. By default, a gray oval highlights the text on press down.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>bool</td><td>No</td><td>iOS</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="testid"></a><code>testID</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#testid" title="Direct link to heading">#</a></h3><p>Used to locate this view in end-to-end tests.</p><table><thead><tr><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>string</td><td>No</td></tr></tbody></table><hr><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="textbreakstrategy"></a><code>textBreakStrategy</code><a aria-hidden="true" tabindex="-1" class="hash-link" href="#textbreakstrategy" title="Direct link to heading">#</a></h3><p>Set text break strategy on Android API Level 23+, possible values are <code>simple</code>, <code>highQuality</code>, <code>balanced</code> The default value is <code>highQuality</code>.</p><table><thead><tr><th>Type</th><th>Required</th><th>Platform</th></tr></thead><tbody><tr><td>enum('simple', 'highQuality', 'balanced')</td><td>No</td><td>Android</td></tr></tbody></table><h1><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_3pqN" id="known-issues"></a>Known issues<a aria-hidden="true" tabindex="-1" class="hash-link" href="#known-issues" title="Direct link to heading">#</a></h1><ul><li><a href="https://github.com/facebook/react-native/issues/22811" target="_blank" rel="noopener noreferrer">react-native#22811</a>: Nested Text elements do not support <code>numberOfLines</code> attribute</li></ul></div></article><div class="docMetadata margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/facebook/react-native-website/blob/master/website/versioned_docs/version-0.63/text.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 40 40" style="margin-right:0.3em;vertical-align:sub"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col text--right"><em><small class="docMetadata-updated">Last updated on <time datetime="2020-10-29T04:19:29.000Z" class="docLastUpdatedAt_1gIo">10/29/2020</time></small></em></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Blog list page navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/docs/switch"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Switch</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/docs/textinput"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">TextInput »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_3iuQ"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#nested-text" class="table-of-contents__link">Nested text</a></li><li><a href="#containers" class="table-of-contents__link">Containers</a></li><li><a href="#limited-style-inheritance" class="table-of-contents__link">Limited Style Inheritance</a></li><li><a href="#props" class="table-of-contents__link">Props</a><ul><li><a href="#accessibilityhint" class="table-of-contents__link"><code>accessibilityHint</code></a></li><li><a href="#accessibilitylabel" class="table-of-contents__link"><code>accessibilityLabel</code></a></li><li><a href="#accessibilityrole" class="table-of-contents__link"><code>accessibilityRole</code></a></li><li><a href="#accessibilitystate" class="table-of-contents__link"><code>accessibilityState</code></a></li><li><a href="#accessible" class="table-of-contents__link"><code>accessible</code></a></li><li><a href="#adjustsfontsizetofit" class="table-of-contents__link"><code>adjustsFontSizeToFit</code></a></li><li><a href="#allowfontscaling" class="table-of-contents__link"><code>allowFontScaling</code></a></li><li><a href="#datadetectortype" class="table-of-contents__link"><code>dataDetectorType</code></a></li><li><a href="#disabled" class="table-of-contents__link"><code>disabled</code></a></li><li><a href="#ellipsizemode" class="table-of-contents__link"><code>ellipsizeMode</code></a></li><li><a href="#maxfontsizemultiplier" class="table-of-contents__link"><code>maxFontSizeMultiplier</code></a></li><li><a href="#minimumfontscale" class="table-of-contents__link"><code>minimumFontScale</code></a></li><li><a href="#nativeid" class="table-of-contents__link"><code>nativeID</code></a></li><li><a href="#numberoflines" class="table-of-contents__link"><code>numberOfLines</code></a></li><li><a href="#onlayout" class="table-of-contents__link"><code>onLayout</code></a></li><li><a href="#onlongpress" class="table-of-contents__link"><code>onLongPress</code></a></li><li><a href="#onmoveshouldsetresponder" class="table-of-contents__link"><code>onMoveShouldSetResponder</code></a></li><li><a href="#onpress" class="table-of-contents__link"><code>onPress</code></a></li><li><a href="#onrespondergrant" class="table-of-contents__link"><code>onResponderGrant</code></a></li><li><a href="#onrespondermove" class="table-of-contents__link"><code>onResponderMove</code></a></li><li><a href="#onresponderrelease" class="table-of-contents__link"><code>onResponderRelease</code></a></li><li><a href="#onresponderterminate" class="table-of-contents__link"><code>onResponderTerminate</code></a></li><li><a href="#onresponderterminationrequest" class="table-of-contents__link"><code>onResponderTerminationRequest</code></a></li><li><a href="#onstartshouldsetrespondercapture" class="table-of-contents__link"><code>onStartShouldSetResponderCapture</code></a></li><li><a href="#ontextlayout" class="table-of-contents__link"><code>onTextLayout</code></a></li><li><a href="#pressretentionoffset" class="table-of-contents__link"><code>pressRetentionOffset</code></a></li><li><a href="#selectable" class="table-of-contents__link"><code>selectable</code></a></li><li><a href="#selectioncolor" class="table-of-contents__link"><code>selectionColor</code></a></li><li><a href="#style" class="table-of-contents__link"><code>style</code></a></li><li><a href="#suppresshighlighting" class="table-of-contents__link"><code>suppressHighlighting</code></a></li><li><a href="#testid" class="table-of-contents__link"><code>testID</code></a></li><li><a href="#textbreakstrategy" class="table-of-contents__link"><code>textBreakStrategy</code></a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">Docs</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/docs/getting-started">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/tutorial">Tutorial</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/components-and-apis">Components and APIs</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/more-resources">More Resources</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/help">The React Native Community</a></li><li class="footer__item"><a class="footer__link-item" href="/showcase">Who's using React Native?</a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/react-native" target="_blank" rel="noopener noreferrer" class="footer__link-item">Ask Questions on Stack Overflow</a></li><li class="footer__item"><a href="https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener noreferrer" class="footer__link-item">Contributor Guide</a></li><li class="footer__item"><a href="https://dev.to/t/reactnative" target="_blank" rel="noopener noreferrer" class="footer__link-item">DEV Community</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Find us</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/blog">Blog</a></li><li class="footer__item"><a href="https://twitter.com/reactnative" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter</a></li><li class="footer__item"><a href="https://github.com/facebook/react-native" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">More</h4><ul class="footer__items"><li class="footer__item"><a href="https://reactjs.org/" target="_blank" rel="noopener noreferrer" class="footer__link-item">React</a></li><li class="footer__item"><a href="https://opensource.facebook.com/legal/privacy" target="_blank" rel="noopener noreferrer" class="footer__link-item">Privacy Policy</a></li><li class="footer__item"><a href="https://opensource.facebook.com/legal/terms" target="_blank" rel="noopener noreferrer" class="footer__link-item">Terms of Service</a></li></ul></div></div><div class="text--center"><div class="margin-bottom--sm"><a href="https://opensource.facebook.com" target="_blank" rel="noopener noreferrer" class="footerLogoLink_19Ac"><img class="footer__logo" alt="Facebook Open Source Logo" src="/img/oss_logo.png"></a></div><div>Copyright © 2020 Facebook, Inc.</div></div></div></footer></div>
|
|
<script src="/styles.25dfd8ab.js"></script>
|
|
<script src="/runtime~main.708a3503.js"></script>
|
|
<script src="/main.00cf4c49.js"></script>
|
|
<script src="/1.844dff91.js"></script>
|
|
<script src="/2.e0509fa8.js"></script>
|
|
<script src="/1f391b9e.3f65ce9d.js"></script>
|
|
<script src="/941.a6bd671c.js"></script>
|
|
<script src="/ee5b3385.8c48d415.js"></script>
|
|
<script src="/17896441.8ef96896.js"></script>
|
|
<script src="/b0c8f754.2b2dbfd3.js"></script>
|
|
</body>
|
|
</html> |