Skip to content

Commit 99d39a5

Browse files
docs: note that root property should use __dirname (#2433)
* docs: note that `root` property should use `__dirname` * fix: formatting
1 parent ebbf215 commit 99d39a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/autolinking.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,14 @@ We can leverage CLI configuration to make it "see" React Native libraries that a
135135
module.exports = {
136136
dependencies: {
137137
'local-rn-library': {
138-
root: '/root/libraries',
138+
root: path.join(__dirname, '/path/to/local-rn-library'),
139139
},
140140
},
141141
};
142142
```
143143

144+
> Note: In the `root` field, it's recommended to use `__dirname` instead of `process.cwd()`. This ensures the path is consistently resolved, regardless of the current working directory.
145+
144146
## How can I use autolinking in a monorepo?
145147

146148
There is nothing extra you need to do - monorepos are supported by default.

docs/projects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Another use-case would be supporting local libraries that are not discoverable f
222222
module.exports = {
223223
dependencies: {
224224
'local-rn-library': {
225-
root: '/root/libraries',
225+
root: path.join(__dirname, '/path/to/library'),
226226
},
227227
},
228228
};

0 commit comments

Comments
 (0)