Skip to content

Commit

Permalink
update docs (#975)
Browse files Browse the repository at this point in the history
Update info about:
 - useTurboModule step on Android (We no longer use TurboModuleManager on Android)
 - The constructor signature of TurboModuleManager  has changed on iOS
  • Loading branch information
Szymon20000 authored Jul 17, 2020
1 parent 13fd4f8 commit 8326034
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ project.ext.react = [
...
```

> **_NOTE:_** In previous releases, we required an additional step which is turning on Turbo Modules.
> If you are upgrading from alpha.{ <=3 } please remove the following lines:
> ```Java
> static {
> ReactFeatureFlags.useTurboModules = true;
> }
> ```
> from `MainActivity.java`.
You can refer [to this diff](https://github.com/software-mansion-labs/reanimated-2-playground/commit/938d494e9512d9fb82c30c23cc80f82c02abd9ea) that presents the set of the above changes made to a fresh react native project in our [Playground repo](https://github.com/software-mansion-labs/reanimated-2-playground).
## iOS
Expand Down Expand Up @@ -136,7 +145,9 @@ If not, after making those changes your app will be compatible with Turbo Module
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
{
_bridge_reanimated = bridge;
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge delegate:self];
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
delegate:self
jsInvoker:bridge.jsCallInvoker];
#if RCT_DEV
[_turboModuleManager moduleForName:"RCTDevMenu"]; // <- add
#endif
Expand Down Expand Up @@ -191,6 +202,15 @@ If not, after making those changes your app will be compatible with Turbo Module
}
@end
```
```
6. ( Additinal step for React Native 0.62.* ) Change initialization of TurboModuleManager
```objectivec {3-3}
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
{
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge delegate:self];
...
```
You can refer [to this diff](https://github.com/software-mansion-labs/reanimated-2-playground/commit/f6f2b77496bc00601150f98ea19a341f844d06a3) that presents the set of the above changes made to a fresh react native project in our [Playground repo](https://github.com/software-mansion-labs/reanimated-2-playground).

0 comments on commit 8326034

Please sign in to comment.