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: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,6 +195,16 @@ Example:
195
195
["aar", { "reverseJetify": true }]
196
196
```
197
197
198
+
## FAQ
199
+
200
+
### How do I add a react-native library containing native code as a dependency in my library?
201
+
202
+
If your library depends on another react-native library containing native code, you should do the following:
203
+
204
+
- Add the native library to `peerDependencies`: This makes sure that there are no conflicts between the version you have specified and the version user has installed (in case they also want to use that library). By deferring the installation to the user, it also makes sure the package manager installs it in correct location and that autolinking can work properly.
205
+
- Add the native library to `devDependencies`: This makes sure that you can use it for tests, and there are no other errors such as type errors due to the missing module.
206
+
- Add the native library to `dependencies` under `example`: This is equivalent to the consumer of the library installing the dependency, and is needed so that this module is also available to the example app.
207
+
198
208
## Development workflow
199
209
200
210
To get started with the project, run `yarn` in the root directory to install the required dependencies.
0 commit comments