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/pages/create.md
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,16 @@ After the project is created, you can find the development workflow in the gener
31
31
32
32
## Local library
33
33
34
-
While the default templates are for libraries that are published to npm, you can also create a local library that is not published, but used locally in your app. The local library is created outside of the `android` and `ios` folders and makes use of autolinking to integrate with your app. It also doesn't include a separate example app and additional dependencies that are configured in the default templates. This is an alternative approach to the setup mentioned in [React Native docs](https://reactnative.dev).
34
+
While the default templates are for libraries that are published to npm, you can also create a local library that is not published, but used locally in your app.
35
35
36
36
If you run `create-react-native-library` in an existing project containing a `package.json`, it'll be automatically detected and you'll be asked if you want to create a local library. You can also pass the `--local` flag to the command to explicitly create a local library:
The local library is created outside of the `android` and `ios` folders and makes use of autolinking to integrate with your app. It also doesn't include a separate example app and additional dependencies that are configured in the default templates. This is an alternative approach to the setup mentioned in [React Native docs](https://reactnative.dev).
43
+
42
44
The advantages of this approach are:
43
45
44
46
- It's easier to upgrade React Native as you don't need to worry about custom code in `android` and `ios` folders.
@@ -56,3 +58,13 @@ By default, the generated library is automatically linked to the project using `
56
58
```
57
59
58
60
This creates a symlink to the library under `node_modules` which makes autolinking work. But if you're using a monorepo or have non-standard setup, you'll need to manually set up the package to be linked to your app based on your project setup.
61
+
62
+
## Writing native code
63
+
64
+
Once the project is created, you can follow the official React Native docs to learn the API for writing native modules and components:
0 commit comments