PageSourceSearch

https://reactnative.dev/assets/js/1ddf62ae.af2a0eb1.js

js reactnative.dev collected 2026-09-24 07:17:28 UTC 25,978 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkreact_native_website=self.webpackChunkreact_native_website||[]).push([["14857"],{1576(e,t,n){n.r(t),n.d(t,{metadata:()=>a,default:()=>f,frontMatter:()=>c,contentTitle:()=>d,toc:()=>h,assets:()=>u});var a=JSON.parse('{"id":"tutorial","title":"Learn the Basics","description":"React Native is like React, but it uses native components instead of web components as building blocks. So to understand the basic structure of a React Native app, you need to understand some of the basic React concepts, like JSX, components, state, and props. If you already know React, you still need to learn some React Native specific stuff, like the native components. This tutorial is aimed at all audiences, whether you have React experience or not.","source":"@site/../docs/tutorial.md","sourceDirName":".","slug":"/tutorial","permalink":"/docs/next/tutorial","draft":false,"unlisted":false,"editUrl":"[{\\"label\\":\\"Edit this page\\",\\"href\\":\\"https://github.com/facebook/react-native-website/edit/main/docs/tutorial.md\\"}]","tags":[],"version":"current","lastUpdatedAt":1780494561000,"frontMatter":{"id":"tutorial","title":"Learn the Basics"}}'),s=n(62540),o=n(43023),i=n(77779),r=n(98263),l=n(38469);let c={id:"tutorial",title:"Learn the Basics"},d,u={},h=[{value:"Hello World",id:"hello-world",level:2},{value:"What&#39;s going on here?",id:"whats-going-on-here",level:2},{value:"Components",id:"components",level:2},{value:"Props",id:"props",level:2},{value:"State",id:"state",level:2},{value:"What&#39;s the difference between state and props in React?",id:"whats-the-difference-between-state-and-props-in-react",level:4},{value:"Are there differences between React and React Native to handle the state?",id:"are-there-differences-between-react-and-react-native-to-handle-the-state",level:4}];function p(e){let t={a:"a",code:"code",div:"div",em:"em",h2:"h2",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["React Native is like React, but it uses native components instead of web components as building blocks. So to understand the basic structure of a React Native app, you need to understand some of the basic React concepts, like JSX, components, ",(0,s.jsx)(t.code,{children:"state"}),", and ",(0,s.jsx)(t.code,{children:"props"}),". If you already know React, you still need to learn some React Native specific stuff, like the native components. This tutorial is aimed at all audiences, whether you have React experience or not."]}),"\n",(0,s.jsx)(t.p,{children:"Let's do this thing."}),"\n",(0,s.jsx)(t.h2,{id:"hello-world",children:"Hello World"}),"\n",(0,s.jsx)(t.p,{children:'In accordance with the ancient traditions of our people, we must first build an app that does nothing except say "Hello, world!". Here it is:'}),"\n",(0,s.jsx)(t.div,{className:"snack-player","data-snack-name":"Hello World","data-snack-description":"Example usage","data-snack-files":"%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20%7BText%2C%20View%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20HelloWorldApp%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20return%20(%5Cn%20%20%20%20%3CView%5Cn%20%20%20%20%20%20style%3D%7B%7B%5Cn%20%20%20%20%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20%20%20%20%20justifyContent%3A%20'center'%2C%5Cn%20%20%20%20%20%20%20%20alignItems%3A%20'center'%2C%5Cn%20%20%20%20%20%20%7D%7D%3E%5Cn%20%20%20%20%20%20%3CText%3EHello%2C%20world!%3C%2FText%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cnexport%20default%20HelloWorldApp%3B%22%7D%7D","data-snack-dependencies":"react-native-safe-area-context","data-snack-platform":"web","data-snack-supported-platforms":"ios,android,web","data-snack-theme":"light","data-snack-preview":"true","data-snack-loading":"lazy","data-snack-device-appearance":"light","data-snack-device-frame":"false"}),"\n",(0,s.jsxs)(t.p,{children:["If you are feeling curious, you can play around with sample code directly in the web simulators. You can also paste it into your ",(0,s.jsx)(t.code,{children:"App.js"})," file to create a real app on your local machine."]}),"\n",(0,s.jsx)(t.h2,{id:"whats-going-on-here",children:"What's going on here?"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["First of all, we need to import ",(0,s.jsx)(t.code,{children:"React"})," to be able to use ",(0,s.jsx)(t.code,{children:"JSX"}),", which will then be transformed to the native components of each platform."]}),"\n",(0,s.jsxs)(t.li,{children:["On line 2, we import the ",(0,s.jsx)(t.code,{children:"Text"})," and ",(0,s.jsx)(t.code,{children:"View"})," components from ",(0,s.jsx)(t.code,{children:"react-native"})]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["Then we define the ",(0,s.jsx)(t.code,{children:"HelloWorldApp"})," function, which is a ",(0,s.jsx)(t.a,{href:"https://react.dev/reference/react/Component",children:"function component"})," and behaves in the same way as in React for the web. This function returns a ",(0,s.jsx)(t.code,{children:"View"})," component with some styles and a",(0,s.jsx)(t.code,{children:"Text"})," as its child."]}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"Text"})," component allows us to render a text, while the ",(0,s.jsx)(t.code,{children:"View"})," component renders a container. This container has several styles applied, let's analyze what each one is doing."]}),"\n",(0,s.jsxs)(t.p,{children:["The first style that we find is ",(0,s.jsx)(t.code,{children:"flex: 1"}),", the ",(0,s.jsx)(t.a,{href:"layout-props#flex",children:(0,s.jsx)(t.code,{children:"flex"})}),' prop will define how your items are going to "fill" over the available space along your main axis. Since we only have one container, it will take all the available space of the parent component. In this case, it is the only component, so it will take all the available screen space.']}),"\n",(0,s.jsxs)(t.p,{children:["The following style is ",(0,s.jsx)(t.a,{href:"layout-props#justifycontent",children:(0,s.jsx)(t.code,{children:"justifyContent"})}),': "center". This aligns children of a container in the center of the container\'s main axis. Finally, we have ',(0,s.jsx)(t.a,{href:"layout-props#alignitems",children:(0,s.jsx)(t.code,{children:"alignItems"})}),': "center", which aligns children of a container in the center of the container\'s cross axis.']}),"\n",(0,s.jsxs)(t.p,{children:["Some of the things in here might not look like JavaScript to you. Don't panic. ",(0,s.jsx)(t.em,{children:"This is the future"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["First of all, ES2015 (also known as ES6) is a set of improvements to JavaScript that is now part of the official standard, but not yet supported by all browsers, so often it isn't used yet in web development. React Native ships with ES2015 support, so you can use this stuff without worrying about compatibility. ",(0,s.jsx)(t.code,{children:"import"}),", ",(0,s.jsx)(t.code,{children:"export"}),", ",(0,s.jsx)(t.code,{children:"const"})," and ",(0,s.jsx)(t.code,{children:"from"})," in the example above are all ES2015 features. If you aren't familiar with ES2015, you can probably pick it up by reading through sample code like this tutorial has. If you want, ",(0,s.jsx)(t.a,{href:"https://babeljs.io/learn-es2015/",children:"this page"})," has a good overview of ES2015 features."]}),"\n",(0,s.jsxs)(t.p,{children:["The other unusual thing in this code example is ",(0,s.jsx)(t.code,{children:"<View><Text>Hello world!</Text></View>"}),". This is JSX - a syntax for embedding XML within JavaScript. Many frameworks use a specialized templating language which lets you embed code inside markup language. In React, this is reversed. JSX lets you write your markup language inside code. It looks like HTML on the web, except instead of web things like ",(0,s.jsx)(t.code,{children:"<div>"})," or ",(0,s.jsx)(t.code,{children:"<span>"}),", you use React components. In this case, ",(0,s.jsx)(t.code,{children:"<Text>"})," is a ",(0,s.jsx)(t.a,{href:"intro-react-native-components",children:"Core Component"})," that displays some text and ",(0,s.jsx)(t.code,{children:"View"})," is like the ",(0,s.jsx)(t.code,{children:"<div>"})," or ",(0,s.jsx)(t.code,{children:"<span>"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"components",children:"Components"}),"\n",(0,s.jsxs)(t.p,{children:["So this code is defining ",(0,s.jsx)(t.code,{children:"HelloWorldApp"}),", a new ",(0,s.jsx)(t.code,{children:"Component"}),". When you're building a React Native app, you'll be making new components a lot. Anything you see on the screen is some sort of component."]}),"\n",(0,s.jsx)(t.h2,{id:"props",children:"Props"}),"\n",(0,s.jsx)(t.p,{children:"Most components can be customized when they are created, with different parameters. These creation parameters are called props."}),"\n",(0,s.jsxs)(t.p,{children:["Your own components can also use ",(0,s.jsx)(t.code,{children:"props"}),". This lets you make a single component that is used in many different places in your app, with slightly different properties in each place. Refer to ",(0,s.jsx)(t.code,{children:"props.YOUR_PROP_NAME"})," in your functional components or ",(0,s.jsx)(t.code,{children:"this.props.YOUR_PROP_NAME"})," in your class components. Here's an example:"]}),"\n",(0,s.jsxs)(i.A,{groupId:"language",queryString:!0,defaultValue:l.A.defaultSnackLanguage,values:l.A.snackLanguages,children:[(0,s.jsx)(r.A,{value:"javascript",children:(0,s.jsx)(t.div,{className:"snack-player","data-snack-name":"Hello Props","data-snack-description":"Example usage","data-snack-files":"%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20%7BText%2C%20View%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20center%3A%20%7B%5Cn%20%20%20%20alignItems%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%7D
1)%3B%5Cn%5Cnconst%20Greeting%20%3D%20props%20%3D%3E%20%7B%5Cn%20%20return%20(%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.center%7D%3E%5Cn%20%20%20%20%20%20%3CText%3EHello%20%7Bprops.name%7D!%3C%2FText%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20LotsOfGreetings%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20return%20(%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.center%2C%20%7Btop%3A%2050%7D%5D%7D%3E%5Cn%20%20%20%20%20%20%3CGreeting%20name%3D%5C%22Rexxar%5C%22%20%2F%3E%5Cn%20%20%20%20%20%20%3CGreeting%20name%3D%5C%22Jaina%5C%22%20%2F%3E%5Cn%20%20%20%20%20%20%3CGreeting%20name%3D%5C%22Valeera%5C%22%20%2F%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnexport%20default%20LotsOfGreetings%3B%22%7D%7D","data-snack-dependencies":"react-native-safe-area-context","data-snack-platform":"web","data-snack-supported-platforms":"ios,android,web","data-snack-theme":"light","data-snack-preview":"true","data-snack-loading":"lazy","data-snack-device-appearance":"light","data-snack-device-frame":"false"})}),(0,s.jsx)(r.A,{value:"typescript",children:(0,s.jsx)(t.div,{className:"snack-player","data-snack-name":"Hello Props","data-snack-description":"Example usage","data-snack-files":"%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20%7BText%2C%20View%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20center%3A%20%7B%5Cn%20%20%20%20alignItems%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cntype%20GreetingProps%20%3D%20%7B%5Cn%20%20name%3A%20string%3B%5Cn%7D%3B%5Cn%5Cnconst%20Greeting%20%3D%20(props%3A%20GreetingProps)%20%3D%3E%20%7B%5Cn%20%20return%20(%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.center%7D%3E%5Cn%20%20%20%20%20%20%3CText%3EHello%20%7Bprops.name%7D!%3C%2FText%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20LotsOfGreetings%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20return%20(%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.center%2C%20%7Btop%3A%2050%7D%5D%7D%3E%5Cn%20%20%20%20%20%20%3CGreeting%20name%3D%5C%22Rexxar%5C%22%20%2F%3E%5Cn%20%20%20%20%20%20%3CGreeting%20name%3D%5C%22Jaina%5C%22%20%2F%3E%5Cn%20%20%20%20%20%20%3CGreeting%20name%3D%5C%22Valeera%5C%22%20%2F%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnexport%20default%20LotsOfGreetings%3B%22%7D%7D","data-snack-dependencies":"react-native-safe-area-context","data-snack-platform":"web","data-snack-supported-platforms":"ios,android,web","data-snack-theme":"light","data-snack-preview":"true","data-snack-loading":"lazy","data-snack-device-appearance":"light","data-snack-device-frame":"false"})})]}),"\n",(0,s.jsxs)(t.p,{children:["Using ",(0,s.jsx)(t.code,{children:"name"})," as a prop lets us customize the ",(0,s.jsx)(t.code,{children:"Greeting"})," component, so we can reuse that component for each of our greetings. This example also uses the ",(0,s.jsx)(t.code,{children:"Greeting"})," component in JSX. The power to do this is what makes React so cool."]}),"\n",(0,s.jsxs)(t.p,{children:["The other new thing going on here is the ",(0,s.jsx)(t.a,{href:"/docs/next/view",children:(0,s.jsx)(t.code,{children:"View"})})," component. A ",(0,s.jsx)(t.a,{href:"/docs/next/view",children:(0,s.jsx)(t.code,{children:"View"})})," is useful as a container for other components, to help control style and layout."]}),"\n",(0,s.jsxs)(t.p,{children:["With ",(0,s.jsx)(t.code,{children:"props"})," and the basic ",(0,s.jsx)(t.a,{href:"/docs/next/text",children:(0,s.jsx)(t.code,{children:"Text"})}),", ",(0,s.jsx)(t.a,{href:"/docs/next/image",children:(0,s.jsx)(t.code,{children:"Image"})}),", and ",(0,s.jsx)(t.a,{href:"/docs/next/view",children:(0,s.jsx)(t.code,{children:"View"})})," components, you can build a wide variety of static screens. To learn how to make your app change over time, you need to ",(0,s.jsx)(t.a,{href:"#state",children:"learn about State"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"state",children:"State"}),"\n",(0,s.jsxs)(t.p,{children:["Unlike props ",(0,s.jsx)(t.a,{href:"https://react.dev/reference/react/Component#props",children:"that are read-only"})," and should not be modified, the ",(0,s.jsx)(t.code,{children:"state"})," allows React components to change their output over time in response to user actions, network responses and anything else."]}),"\n",(0,s.jsx)(t.h4,{id:"whats-the-difference-between-state-and-props-in-react",children:"What's the difference between state and props in React?"}),"\n",(0,s.jsx)(t.p,{children:"In a React component, the props are the variables that we pass from a parent component to a child component. Similarly, the state are also variables, with the difference that they are not passed as parameters, but rather that the component initializes and manages them internally."}),"\n",(0,s.jsx)(t.h4,{id:"are-there-differences-between-react-and-react-native-to-handle-the-state",children:"Are there differences between React and React Native to handle the state?"}),"\n",(0,s.jsxs)("div",{className:"two-columns",children:[(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-tsx",metastring:'title="React TSX"',children:"// React Counter Example using Hooks!\n\nimport {useState} from 'react';\n\n\n\nconst App = () => {\n  const [count, setCount] = useState(0);\n\n  return (\n    <div className=\"container\">\n      <p>You clicked {count} times</p>\n      <button\n        onClick={() => setCount(count + 1)}>\n        Click me!\n      </button>\n    </div>\n  );\n};\n\n\n// CSS\n.container {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n"})}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-tsx",metastring:'title="React TSX"',children:"// React Native Counter Example using Hooks!\n\nimport {useState} from 'react';\nimport {View, Text, Button, StyleSheet} from 'react-native';\n\nconst App = () => {\n  const [count, setCount] = useState(0);\n\n  return (\n    <View style={styles.container}>\n      <Text>You clicked {count} times</Text>\n      <Button\n        onPress={() => setCount(count + 1)}\n        title=\"Click me!\"\n      />\n    </View>\n  );\n};\n\n// React Native Styles\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    al
1ignItems: 'center',\n  },\n});\n"})})]}),"\n",(0,s.jsxs)(t.p,{children:["As shown above, there is no difference in handling the ",(0,s.jsx)(t.code,{children:"state"})," between ",(0,s.jsx)(t.a,{href:"https://react.dev/learn/state-a-components-memory",children:"React"})," and ",(0,s.jsx)(t.code,{children:"React Native"}),". You can use the state of your components both in classes and in function components using ",(0,s.jsx)(t.a,{href:"https://react.dev/reference/react/useState",children:"hooks"}),"!"]}),"\n",(0,s.jsx)(t.p,{children:"In the following example we will show the same above counter example using classes."}),"\n",(0,s.jsx)(t.div,{className:"snack-player","data-snack-name":"Hello Classes","data-snack-description":"Example usage","data-snack-files":"%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20%7BComponent%7D%20from%20'react'%3B%5Cnimport%20%7BStyleSheet%2C%20TouchableOpacity%2C%20Text%2C%20View%7D%20from%20'react-native'%3B%5Cn%5Cnclass%20App%20extends%20Component%20%7B%5Cn%20%20state%20%3D%20%7B%5Cn%20%20%20%20count%3A%200%2C%5Cn%20%20%7D%3B%5Cn%5Cn%20%20onPress%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20%20%20this.setState(%7B%5Cn%20%20%20%20%20%20count%3A%20this.state.count%20%2B%201%2C%5Cn%20%20%20%20%7D)%3B%5Cn%20%20%7D%3B%5Cn%5Cn%20%20render()%20%7B%5Cn%20%20%20%20return%20(%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.container%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%20style%3D%7Bstyles.button%7D%20onPress%3D%7Bthis.onPress%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%3EClick%20me%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20%20%20%3CView%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%3EYou%20clicked%20%7Bthis.state.count%7D%20times%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20)%3B%5Cn%20%20%7D%5Cn%7D%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20justifyContent%3A%20'center'%2C%5Cn%20%20%20%20alignItems%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20alignItems%3A%20'center'%2C%5Cn%20%20%20%20backgroundColor%3A%20'%23DDDDDD'%2C%5Cn%20%20%20%20padding%3A%2010%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20App%3B%22%7D%7D","data-snack-dependencies":"react-native-safe-area-context","data-snack-platform":"web","data-snack-supported-platforms":"ios,android,web","data-snack-theme":"light","data-snack-preview":"true","data-snack-loading":"lazy","data-snack-device-appearance":"light","data-snack-device-frame":"false"})]})}function f(e={}){let{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},98263(e,t,n){n.d(t,{A:()=>r});var a=n(62540);n(63696);var s=n(11750),o=n(23865);function i({children:e,className:t,hidden:n}){return(0,a.jsx)("div",{role:"tabpanel",className:(0,s.A)("tabItem_wHwb",t),hidden:n,children:e})}function r({children:e,className:t,value:n}){let{selectedValue:s,lazy:l}=(0,o.uc)(),c=n===s;return!c&&l?null:(0,a.jsx)(i,{className:t,hidden:!c,children:e})}},77779(e,t,n){n.d(t,{A:()=>h});var a=n(62540);n(63696);var s=n(11750),o=n(46065),i=n(23865),r=n(45194),l=n(83029);function c({className:e}){let{selectedValue:t,selectValue:n,tabValues:o,block:l}=(0,i.uc)(),d=[],{blockElementScrollPositionUntilNextRender:u}=(0,r.a_)(),h=e=>{let a=e.currentTarget,s=o[d.indexOf(a)].value;s!==t&&(u(a),n(s))},p=e=>{let t=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let n=d.indexOf(e.currentTarget)+1;t=d[n]??d[0];break}case"ArrowLeft":{let n=d.indexOf(e.currentTarget)-1;t=d[n]??d[d.length-1]}}t?.focus()};return(0,a.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":l},e),children:o.map(({value:e,label:n,attributes:o})=>(0,a.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{d.push(e)},onKeyDown:p,onClick:h,...o,className:(0,s.A)("tabs__item","tabItem_l0OV",o?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function d({children:e}){return(0,a.jsx)("div",{className:"margin-top--md",children:e})}function u({className:e,children:t}){return(0,a.jsxs)("div",{className:(0,s.A)(o.G.tabs.container,"tabs-container","tabList_J5MA"),children:[(0,a.jsx)(c,{className:e}),(0,a.jsx)(d,{children:t})]})}function h(e){let t=(0,l.A)(),n=(0,i.OC)(e);return(0,a.jsx)(i.O_,{value:n,children:(0,a.jsx)(u,{className:e.className,children:(0,i.vT)(e.children)})},String(t))}}
1,23865(e,t,n){n.d(t,{OC:()=>h,O_:()=>m,uc:()=>f,vT:()=>d});var a=n(62540),s=n(63696),o=n(49519),i=n(6743),r=n(88511),l=n(15396),c=n(89030);function d(e){return s.Children.toArray(e).filter(e=>"\n"!==e)}function u({value:e,tabValues:t}){return t.some(t=>t.value===e)}function h(e){let t,{defaultValue:n,queryString:a=!1,groupId:d}=e,h=function(e){let{values:t,children:n}=e;return(0,s.useMemo)(()=>{let e=t??s.Children.toArray(n).flatMap(e=>{if(!e)return[];if((0,s.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return[e];let t="string"==typeof e.type?e.type:e.type.name;throw Error(`Docusaurus error: Bad <Tabs> child <${t}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.
2If you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)}).map(({props:{value:e,label:t,attributes:n,default:a}})=>({value:e,label:t,attributes:n,default:a})),a=(0,l.XI)(e,(e,t)=>e.value===t.value);if(a.length>0)throw Error(`Docusaurus error: Duplicate values "${a.map(e=>`'${e.value}'`).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[t,n])}(e),[p,f]=(0,s.useState)(()=>(function({defaultValue:e,tabValues:t}){if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!u({value:e,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}let n=t.find(e=>e.default)??t[0];if(!n)throw Error("Unexpected error: 0 tabValues");return n.value})({defaultValue:n,tabValues:h})),[m,C]=function({queryString:e=!1,groupId:t}){let n=(0,o.W6)(),a=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,r.aZ)(a),(0,s.useCallback)(e=>{if(!a)return;let t=new URLSearchParams(n.location.search);t.set(a,e),n.replace({...n.location,search:t.toString()})},[a,n])]}({queryString:a,groupId:d}),[x,v]=function({groupId:e}){let t=e?`docusaurus.tab.${e}`:null,[n,a]=(0,c.Dv)(t);return[n,(0,s.useCallback)(e=>{t&&a.set(e)},[t,a])]}({groupId:d}),w=u({value:t=m??x,tabValues:h})?t:null;return(0,i.A)(()=>{w&&f(w)},[w]),{selectedValue:p,selectValue:(0,s.useCallback)(e=>{if(!u({value:e,tabValues:h}))throw Error(`Can't select invalid tab value=${e}`);f(e),C(e),v(e)},[C,v,h]),tabValues:h,lazy:e.lazy??!1,block:e.block??!1}}let p=(0,s.createContext)(null);function f(){let e=s.useContext(p);if(!e)throw Error("useTabsContext() must be used within a Tabs component");return e}function m(e){return(0,a.jsx)(p.Provider,{value:e.value,children:e.children})}},38469(e,t,n){n.d(t,{A:()=>i});var a=n(93227);let s=!!a.A.canUseDOM&&navigator.platform.startsWith("Mac"),o=!!a.A.canUseDOM&&navigator.platform.startsWith("Win"),i={defaultGuide:"quickstart",defaultJsDebugger:"flipper",defaultOs:s?"macos":o?"windows":"linux",defaultPackageManager:"npm",defaultPlatform:s?"ios":"android",defaultSyntax:"functional",defaultAndroidLanguage:"java",defaultAppleLanguage:"objc",defaultJavaScriptSpecLanguages:"typescript",getDevNotesTabs:(e=["android","ios","web","windows"])=>[e.includes("android")?{label:"Android",value:"android"}:void 0,e.includes("ios")?{label:"iOS",value:"ios"}:void 0,e.includes("web")?{label:"Web",value:"web"}:void 0,e.includes("windows")?{label:"Windows",value:"windows"}:void 0].filter(Boolean),guides:[{label:"Expo Go Quickstart",value:"quickstart"},{label:"React Native CLI Quickstart",value:"native"}],oses:[{label:"macOS",value:"macos"},{label:"Windows",value:"windows"},{label:"Linux",value:"linux"}],packageManagers:[{label:"npm",value:"npm"},{label:"Yarn",value:"yarn"}],platforms:[{label:"Android",value:"android"},{label:"iOS",value:"ios"}],syntax:[{label:"Function Component",value:"functional"},{label:"Class Component",value:"classical"}],androidLanguages:[{label:"Java",value:"java"},{label:"Kotlin",value:"kotlin"}],appleLanguages:[{label:"ObjectiveC",value:"objc"},{label:"Swift",value:"swift"}],javaScriptSpecLanguages:[{label:"TypeScript",value:"typescript"},{label:"Flow",value:"flow"}],jsDebuggers:[{label:"Hermes Debugger / Expo",value:"hermes"},{label:"Flipper",value:"flipper"},{label:"New Debugger (Experimental)",value:"new-debugger"}],snackLanguages:[{label:"TypeScript",value:"typescript"},{label:"JavaScript",value:"javascript"}],defaultSnackLanguage:"typescript"}},43023(e,t,n){n.d(t,{R:()=>i,x:()=>r});var a=n(63696);let s={},o=a.createContext(s);function i(e){let t=a.useContext(o);return a.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),a.createElement(o.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.