Skip to content

Commit

Permalink
Merge pull request #3970 from js-newbee/fix_docs_rn
Browse files Browse the repository at this point in the history
fix(docs): react native 端的 moduleName
  • Loading branch information
Pines-Cheng authored Sep 6, 2019
2 parents 529dec2 + 7150a66 commit 0060d7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/react-native.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ iOS 的启动比较简单,使用 Xcode 打开 ios 目录,然后点击 Run

![image](https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/Art/XC_O_SchemeMenuWithCallouts_2x.png)

这里需要注意的是 jsBundle 的 moduleName,默认的 moduleName 为 "taro-demo",需要和 `rn_temp/app.json` 里面的 name 字段保持一致。该配置在 `AppDelegate.m` 文件中。
这里需要注意的是 jsBundle 的 moduleName,默认的 moduleName 为 "taroDemo",需要和 `rn_temp/app.json` 里面的 name 字段保持一致。该配置在 `AppDelegate.m` 文件中。

```objc
@implementation AppDelegate
Expand All @@ -346,7 +346,7 @@ iOS 的启动比较简单,使用 Xcode 打开 ios 目录,然后点击 Run
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"rn_temp/index" fallbackResource:nil];

RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"taro-demo"
moduleName:@"taroDemo"
initialProperties:nil
launchOptions:launchOptions];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
Expand Down

0 comments on commit 0060d7c

Please sign in to comment.