Skip to content

Commit 342c565

Browse files
committed
update
1 parent 34b6626 commit 342c565

File tree

72 files changed

+2457
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2457
-363
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import IOSContent from "./fabric-native-components-ios.md";
3+
import AndroidContent from "./fabric-native-components-android.md";
4+
5+
export function FabricNativeComponentsIOS() {
6+
return <IOSContent />;
7+
}
8+
9+
export function FabricNativeComponentsAndroid() {
10+
return <AndroidContent />;
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import IOSContent from "./turbo-native-modules-ios.md";
3+
import AndroidContent from "./turbo-native-modules-android.md";
4+
5+
export function TurboNativeModulesIOS() {
6+
return <IOSContent />;
7+
}
8+
9+
export function TurboNativeModulesAndroid() {
10+
return <AndroidContent />;
11+
}
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
---
2-
id: new-architecture-appendix
3-
title: Appendix
4-
---
5-
6-
import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
7-
import VerticalTable from '@site/core/VerticalTable';
8-
9-
<NewArchitectureWarning/>
10-
111
## 一、术语
122

133
整个与新架构相关的指南将遵循以下**术语**
144

15-
- **传统原生组件** - 指运行在旧版 React Native 架构上的组件。
16-
- **传统原生模块** - 指运行在旧版 React Native 架构上的模块。
5+
- **Spec** - TypeScript or Flow code that describes the API for a Turbo Native Module or Fabric Native component. Used by **Codegen** to generate boilerplate code.
6+
177
- **Fabric 原生组件** - 指已经适配以与新架构(即新渲染器)良好协同工作的组件。为简洁起见,您可能会看到它们被称为**Fabric 组件**
188
- **Turbo 原生模块** - 指已经适配以与新架构(即新原生模块系统)良好协同工作的模块。为简洁起见,您可能会看到它们被称为**Turbo 模块**
9+
10+
- **传统原生组件** - 指运行在旧版 React Native 架构上的组件。
11+
- **传统原生模块** - 指运行在旧版 React Native 架构上的模块。
12+
1913

2014
## II. Flow 类型到原生类型的映射
2115

cndocs/debugging-native-code.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
id: debugging-native-code
3+
title: 调试原生代码
4+
---
5+
6+
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
7+
8+
<div className="banner-native-code-required">
9+
<h3>Projects with Native Code Only</h3>
10+
<p>The following section only applies to projects with native code exposed. If you are using the managed Expo workflow, see the guide on <a href="https://docs.expo.dev/workflow/prebuild/" target="_blank">prebuild</a> to use this API.</p>
11+
</div>
12+
13+
## Accessing Logs
14+
15+
You can display the native logs for an iOS or Android app by using the following commands in a terminal while the app is running:
16+
17+
```shell
18+
# For Android:
19+
npx react-native log-android
20+
# Or, for iOS:
21+
npx react-native log-ios
22+
```
23+
24+
You may also access these through Debug > Open System Log… in the iOS Simulator or by running `adb logcat "*:S" ReactNative:V ReactNativeJS:V` in a terminal while an Android app is running on a device or emulator.
25+
26+
## Debugging in a Native IDE
27+
28+
When working with native code, such as when writing native modules, you can launch the app from Android Studio or Xcode and take advantage of the native debugging features (setting up breakpoints, etc.) as you would in case of building a standard native app.
29+
30+
Another option is to run your application using the React Native CLI and attach the native debugger of the native IDE (Android Studio or Xcode) to the process.
31+
32+
### Android Studio
33+
34+
On Android Studio you can do this by going on the "Run" option on the menu bar, clicking on "Attach to Process..." and selecting the running React Native app.
35+
36+
### Xcode
37+
38+
On Xcode click on "Debug" on the top menu bar, select the "Attach to process" option, and select the application in the list of "Likely Targets".

0 commit comments

Comments
 (0)