Skip to content

Commit 1b68086

Browse files
committed
docs(SETUP.md): correct and extend other JSI libs example
1 parent 5f9a91b commit 1b68086

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

SETUP.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Since pure JSI Modules cannot be autolinked yet, you have to manually initialize
2121

2222
1. Open your app's `MainApplication.java`
2323
2. Add the following code:
24+
2425
```diff
2526
package com.example.reactnativemultithreading;
2627

@@ -72,8 +73,6 @@ Since pure JSI Modules cannot be autolinked yet, you have to manually initialize
7273

7374
</details>
7475

75-
76-
7776
<details>
7877
<summary>
7978
<b>With react-native-mmkv (or other JSI libs)</b>
@@ -92,13 +91,14 @@ Since pure JSI Modules cannot be autolinked yet, you have to manually initialize
9291
import com.facebook.react.bridge.JSIModuleSpec;
9392
import com.facebook.react.bridge.JavaScriptContextHolder;
9493
import com.facebook.react.bridge.ReactApplicationContext;
94+
9595
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
96-
import com.reactnativemmkv.MultithreadingModule;
96+
import com.reactnativemultithreading.MultithreadingModule;
9797

9898
import java.util.Collections;
9999
import java.util.List;
100100

101-
// TODO: Remove all of this when JSI Modules can be autoinstalled (maybe RN 0.65)
101+
// TODO: Remove all of this when JSI Modules can be auto-installed
102102
public class ExampleJSIPackage extends ReanimatedJSIModulePackage {
103103
@Override
104104
public List<JSIModuleSpec> getJSIModules(ReactApplicationContext reactApplicationContext, JavaScriptContextHolder jsContext) {
@@ -108,9 +108,11 @@ Since pure JSI Modules cannot be autolinked yet, you have to manually initialize
108108
}
109109
}
110110
```
111+
111112
6. Replace `com.example` (first line) with the correct package name
112113
7. Replace `ExampleJSIPackage` with the file name you chose in step 4.
113114
8. Open `MainApplication.java` and find the location where the `ReactNativeHost` is initialized. You have to override it's `getJSIModulePackage` method:
115+
114116
```diff
115117
package com.example.reactnativemultithreading;
116118

0 commit comments

Comments
 (0)