Skip to content

Commit 35481b2

Browse files
BenLorantfythymikeejamesgeorge007
authored
docs: update monorepo autolinking section with a disclaimer (#1341)
* Update monorepo section with another note Adds a note explaining a caveat with auto-linking in a monorepo. Ran into this problem today trying to get a monorepo working. * Update docs/autolinking.md Co-authored-by: James George <[email protected]> * Update docs/autolinking.md Co-authored-by: Michał Pierzchała <[email protected]> Co-authored-by: James George <[email protected]>
1 parent 83aa548 commit 35481b2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/autolinking.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,17 @@ correct location and update them accordingly:
117117
- path to `native_modules.rb` in your `ios/Podfile`
118118
- path to `native_modules.gradle` in your `android/settings.gradle`
119119
- path to `native_modules.gradle` in your `android/app/build.gradle`
120+
121+
Dependencies are only linked if they are listed in the package.json of the mobile workspace, where "react-native" dependency if defined. For example, with this file structure:
122+
```
123+
/root
124+
/packages
125+
/mobile
126+
/ios
127+
/android
128+
package.json <-- Only dependencies listed here are auto-linked
129+
/components
130+
package.json <-- Dependencies here are ignored when auto-linking
131+
package.json
132+
```
133+
In this example, if you add a package with native code as a dependency of `components`, you need to also add it as a dependency of `mobile` for auto-linking to work.

0 commit comments

Comments
 (0)