You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/intro-react-native-components.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
id: intro-react-native-components
3
-
title: Core Components and Native Components
4
-
description: 'React Native lets you compose app interfaces using Native Components. Conveniently, it comes with a set of these components for you to get started with right now—the Core Components!'
3
+
title: Core Components and Fabric Components
4
+
description: 'React Native lets you compose app interfaces using Fabric Components. Conveniently, it comes with a set of these components for you to get started with right now—the Core Components!'
5
5
---
6
6
7
7
import ThemedImage from '@theme/ThemedImage';
@@ -17,13 +17,13 @@ In Android and iOS development, a **view** is the basic building block of UI: a
17
17
<figcaption>Just a sampling of the many views used in Android and iOS apps.</figcaption>
18
18
</figure>
19
19
20
-
## Native Components
20
+
## Fabric Components
21
21
22
-
In Android development, you write views in Kotlin or Java; in iOS development, you use Swift or Objective-C. With React Native, you can invoke these views with JavaScript using React components. At runtime, React Native creates the corresponding Android and iOS views for those components. Because React Native components are backed by the same views as Android and iOS, React Native apps look, feel, and perform like any other apps. We call these platform-backed components **Native Components.**
22
+
In Android development, you write views in Kotlin or Java; in iOS development, you use Swift or Objective-C. With React Native, you can invoke these views with JavaScript using React components. At runtime, React Native creates the corresponding Android and iOS views for those components. Because React Native components are backed by the same views as Android and iOS, React Native apps look, feel, and perform like any other apps. We call these platform-backed components **Fabric Components.**[_Fabric_](architecture/fabric-renderer) is the name of the React Native renderer, therefore components that are rendered via Fabric are called Fabric Components.
23
23
24
-
React Native comes with a set of essential, ready-to-use Native Components you can use to start building your app today. These are React Native's **Core Components**.
24
+
React Native comes with a set of essential, ready-to-use Fabric Components you can use to start building your app today. These are React Native's **Core Components**.
25
25
26
-
React Native also lets you build your own Native Components for [Android](native-components-android.md) and [iOS](native-components-ios.md) to suit your app’s unique needs. We also have a thriving ecosystem of these **community-contributed components.** Check out [Native Directory](https://reactnative.directory) to find what the community has been creating.
26
+
React Native also lets you build your own [Fabric Components](the-new-architecture/pillars-fabric-components) to suit your app’s unique needs. We also have a thriving ecosystem of these **community-contributed components.** Check out [Native Directory](https://reactnative.directory) to find what the community has been creating.
Copy file name to clipboardExpand all lines: docs/introduction.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import con
8
8
9
9
<divclassName="content-banner">
10
10
<p>
11
-
Welcome to the very start of your React Native journey! If you're looking for environment setup instructions, they've moved to <a href="environment-setup">their own section</a>. Continue reading for an introduction to the documentation, Native Components, React, and more!
11
+
Welcome to the very start of your React Native journey! If you're looking for environment setup instructions, they've moved to <a href="environment-setup">their own section</a>. Continue reading for an introduction to the documentation, Fabric Components, React, and more!
@@ -136,4 +136,4 @@ Menu paths are written in bold and use carets to navigate submenus. Example: **A
136
136
137
137
---
138
138
139
-
Now that you know how this guide works, it's time to get to know the foundation of React Native: [Native Components](intro-react-native-components.md).
139
+
Now that you know how this guide works, it's time to get to know the foundation of React Native: [Fabric Components](the-new-architecture/pillars-fabric-components).
Copy file name to clipboardExpand all lines: docs/more-resources.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,10 @@ We recommend using the [VS Code](https://code.visualstudio.com/) code editor and
34
34
35
35
Try out apps from the [Showcase](https://reactnative.dev/showcase) to see what React Native is capable of! Looking for something more hands on? Check out this [set of example apps on GitHub](https://github.com/ReactNativeNews/React-Native-Apps). You can look at their source code—try running one on a simulator or device.
36
36
37
-
## Find, make, and share your own Native Components and Modules
37
+
## Find, make, and share your own Fabric Components and Modules
38
38
39
-
React Native has a community of thousands of developers like you making content, tools, tutorials—and Native Components!
39
+
React Native has a community of thousands of developers like you making content, tools, tutorials—and Fabric Components!
40
40
41
41
Can’t find what you’re looking for in the Core Components? Visit [React Native Directory](https://reactnative.directory) to find what the community has been creating.
42
42
43
-
Interested in making your own Native Component or Module? Making modules for your own use case and sharing them with others on NPM and GitHub helps grow the React Native ecosystem and community! Read the guides to making your own Native Modules ([Android](native-modules-android.md), [iOS](native-modules-ios.md)) and Native Components ([Android](native-components-android.md), [iOS](native-components-ios.md)).
43
+
Interested in making your own Fabric Component or TurboModule? Making modules for your own use case and sharing them with others on NPM and GitHub helps grow the React Native ecosystem and community! Read the guides to making your own [TurboModule](the-new-architecture/pillars-turbomodule.md) and [Fabric Component](the-new-architecture/pillars-fabric-components.md).
Copy file name to clipboardExpand all lines: docs/native-modules-android.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,11 @@ id: native-modules-android
3
3
title: Android Native Modules
4
4
---
5
5
6
+
import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
6
7
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
7
8
9
+
<NativeDeprecated />
10
+
8
11
Welcome to Native Modules for Android. Please start by reading the [Native Modules Intro](native-modules-intro) for an intro to what native modules are.
Copy file name to clipboardExpand all lines: docs/native-modules-intro.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,10 @@ id: native-modules-intro
3
3
title: Native Modules Intro
4
4
---
5
5
6
+
import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
7
+
8
+
<NativeDeprecated />
9
+
6
10
Sometimes a React Native app needs to access a native platform API that is not available by default in JavaScript, for example the native APIs to access Apple or Google Pay. Maybe you want to reuse some existing Objective-C, Swift, Java or C++ libraries without having to reimplement it in JavaScript, or write some high performance, multi-threaded code for things like image processing.
7
11
8
12
The NativeModule system exposes instances of Java/Objective-C/C++ (native) classes to JavaScript (JS) as JS objects, thereby allowing you to execute arbitrary native code from within JS. While we don't expect this feature to be part of the usual development process, it is essential that it exists. If React Native doesn't export a native API that your JS app needs you should be able to export it yourself!
Copy file name to clipboardExpand all lines: docs/native-modules-setup.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,10 @@ id: native-modules-setup
3
3
title: Native Modules NPM Package Setup
4
4
---
5
5
6
+
import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
7
+
8
+
<NativeDeprecated />
9
+
6
10
Native modules are usually distributed as npm packages, except that on top of the usual JavaScript they will include some native code per platform. To understand more about npm packages you may find [this guide](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) useful.
7
11
8
12
To get set up with the basic project structure for a native module we will use the community tool called [create-react-native-library](https://github.com/callstack/react-native-builder-bob). You can go ahead further and dive deep into how that library works, but for our needs we will only execute the basic script:
Copy file name to clipboardExpand all lines: docs/new-architecture-app-intro.md
+10-59Lines changed: 10 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,40 +7,25 @@ import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
7
7
8
8
<NewArchitectureWarning/>
9
9
10
-
There’s a few prerequisites that should be addressed before the new architecture is enabled in your application.
10
+
There’s a few prerequisites that should be addressed before the New Architecture is enabled in your application.
11
11
12
12
## Use a React Native nightly release
13
13
14
14
At this time, you must use a React Native nightly release in order to get access to the most up to date changes. Eventually, we will recommend targeting a minimum stable open source release.
15
15
16
-
This guide is written with the expectation that you’re using a specific nightly release. As new revisions of this guide are released, the target nightly release may be updated. The specific nightly version that we will be using throughout the rest of this guide is version `0.0.0-20220201-2008-79975d146`.
16
+
This guide is written with the expectation that you’re using a specific nightly release. As new revisions of this guide are released, the target nightly release may be updated. The specific nightly version that we will be using throughout the rest of this guide is version `0.0.0-20220705-2052-71e89213a`.
17
17
18
18
Before upgrading your app to a specific nightly release, we recommend upgrading your app to the latest open source release. By upgrading to a published open source release first, you will be able to take advantage of tools like the [upgrade helper](https://react-native-community.github.io/upgrade-helper/) to determine what other changes may be required for your project.
19
19
20
-
As of this writing, the latest stable release is `0.67.2`. Once you have upgraded your project to this version successfully, you may proceed to targeting the `0.0.0-20220201-2008-79975d146` nightly release. You may target this nightly release the same way you’d target any other version of React Native:
20
+
As of this writing, the latest stable release is `0.69.1`. Once you have upgraded your project to this version successfully, you may proceed to targeting the `0.0.0-20220705-2052-71e89213a` nightly release. You may target this nightly release the same way you’d target any other version of React Native:
Make sure that you're using the latest version of the [`react-native-codegen`](https://www.npmjs.com/package/react-native-codegen) NPM package. At the time of writing it's `0.0.13`.
29
-
30
-
```bash
31
-
yarn add react-native-codegen
32
-
```
33
-
34
-
:::info
35
-
36
-
If you see an error like `***TypeError: RNCodegen.generateFromSchemas is not a function.***`, it means that you're using a older version of `react-native-codegen`.
37
-
Make sure you don't have an older version installed under the `node_modules/react-native/node_modules` folder. You can remove that or reinstall everything in node_modules to fix the problem.
38
-
39
-
:::
40
-
41
26
### Android specifics
42
27
43
-
Using the new architecture on Android has some prerequisites that you need to meet:
28
+
Using the New Architecture on Android has some prerequisites that you need to meet:
While the AGP version should be updated inside the **top level**`build.gradle` file at the `com.android.tools.build:gradle` dependency line.
56
41
57
-
If you’re set with it, let’s now install the new Gradle plugin which is distributed through a NPM package called [**`react-native-gradle-plugin`**](https://www.npmjs.com/package/react-native-gradle-plugin). You can do so with:
58
-
59
-
```bash
60
-
yarn add react-native-gradle-plugin
61
-
```
62
-
63
-
You can control if you have the package already installed by doing:
64
-
65
-
```bash
66
-
ls -la node_modules/react-native-gradle-plugin
67
-
```
68
-
69
42
Now, you can edit your **top level**`settings.gradle` file to include the following line at the end of the file:
Hermes is an open-source JavaScript engine optimized for React Native. We highly recommend using Hermes in your application. With Hermes enabled, you will be able to use the JavaScript debugger in Flipper to directly debug your JavaScript code.
95
+
Hermes is an open-source JavaScript engine optimized for React Native. Hermes is enabled by default and you have to explicitly disable it if you want to use JSC.
123
96
124
-
Please [follow the instructions on the React Native website](hermes) in order to enable Hermes in your application.
97
+
We highly recommend using Hermes in your application. With Hermes enabled, you will be able to use the JavaScript debugger in Flipper to directly debug your JavaScript code.
98
+
99
+
Please [follow the instructions on the React Native website](hermes) to learn how to enable/disable Hermes.
125
100
126
101
:::caution
127
102
128
103
**iOS:** If you opt out of using Hermes, you will need to replace `HermesExecutorFactory` with `JSCExecutorFactory` in any examples used throughout the rest of this guide.
129
104
130
105
:::
131
106
132
-
## iOS: Enable C++17 language feature support
133
-
134
-
Your Xcode project settings need to be updated to support C++17 language features.
135
-
136
-
**Instructions**
137
-
138
-
1. Select your project in the Project navigator on the left (e.g. MyXcodeApp)
139
-
2. Then, make sure your project is selected in the center pane (as opposed to a particular target in your project, e.g. MyXcodeApp under Project, not under Targets).
140
-
3. Go to Build Settings
141
-
4. Search for C++ Language Dialect or CLANG_CXX_LANGUAGE_STANDARD
142
-
5. Make sure **C++17** is selected from the dropdown menu (or enter "c++17" directly into the value box).
143
-
144
-
If done correctly, your diff will show the following changes to your project file:
145
-
146
-
```ruby
147
-
CLANG_CXX_LANGUAGE_STANDARD="c++17"
148
-
```
149
-
150
-
:::info
151
-
152
-
Your project should also be configured to support Folly. This should be done automatically once the library dependency is picked up, so no further changes to your project are necessary.
153
-
154
-
:::
155
-
156
107
## iOS: Use Objective-C++ (`.mm` extension)
157
108
158
109
TurboModules can be written using Objective-C or C++. In order to support both cases, any source files that include C++ code should use the `.mm` file extension. This extension corresponds to Objective-C++, a language variant that allows for the use of a combination of C++ and Objective-C in source files.
Copy file name to clipboardExpand all lines: docs/new-architecture-app-renderer-ios.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ end
39
39
40
40
## 2. Update your root view
41
41
42
-
The way to render your app with Fabric depends on your setup. Here is an example of how you can enable Fabric in your app with the `RN_FABRIC_ENABLED` compiler flag to enable/disable. Refer [RN-Tester’s AppDelegate](https://github.com/facebook/react-native/blob/main/packages/rn-tester/RNTester/AppDelegate.mm) as an example.
42
+
How to render your app with Fabric depends on your setup. Here is an example of how you can enable Fabric in your app with the `RN_FABRIC_ENABLED` compiler flag to enable/disable. Refer [RN-Tester’s AppDelegate](https://github.com/facebook/react-native/blob/main/packages/rn-tester/RNTester/AppDelegate.mm) as an example.
0 commit comments