Skip to content

Commit 2cc7a78

Browse files
authored
Improve mocking guide instructions (wix#2724)
1 parent ddbe774 commit 2cc7a78

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/Guide.Mocking.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ This replacement mechanism provides a lot of flexibility to change implementatio
2323

2424
#### Configuration
2525
0. For RN < 0.55, setup `react-native-repackager` in your library.
26-
1. For case 0.55 <= RN < 0.59 create a file called `rn-cli.config.js` in the root folder. If you use RN >= 0.59 (which in turn uses Metro with breaking changes introduced in 0.43 - https://github.com/facebook/metro/releases/tag/v0.43.0) file should have name `metro.config.js` or `metro.config.json` (or define metro field in `package.json`) to root dir. Then set up `resolver.sourceExts` to prioritize any given source extension over the default one:
26+
1. Configure the metro bundler to use the extensions defined by `RN_SRC_EXT`:
27+
- If you use 0.55 <= RN < 0.59, create a file called `rn-cli.config.js` in the root folder.
28+
- If you use RN >= 0.59 (which in turn uses Metro with breaking changes introduced in [0.43](https://github.com/facebook/metro/releases/tag/v0.43.0)) the file should be named `metro.config.js` or `metro.config.json` (or define metro field in `package.json`) to root dir.
29+
30+
Then set up `resolver.sourceExts` to prioritize any given source extension over the default one:
2731

2832
```js
2933
const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts

0 commit comments

Comments
 (0)