File tree 1 file changed +23
-0
lines changed
android/app/src/main/java/com/rnnewarchitectureapp 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .rnnewarchitectureapp ;
2
2
3
3
import com .facebook .react .ReactActivity ;
4
+ import com .facebook .react .ReactActivityDelegate ;
5
+ import com .facebook .react .ReactRootView ;
4
6
5
7
public class MainActivity extends ReactActivity {
6
8
@@ -12,4 +14,25 @@ public class MainActivity extends ReactActivity {
12
14
protected String getMainComponentName () {
13
15
return "RNNewArchitectureApp" ;
14
16
}
17
+
18
+ // Add the Activity Delegate, if you don't have one already.
19
+ public static class MainActivityDelegate extends ReactActivityDelegate {
20
+
21
+ public MainActivityDelegate (ReactActivity activity , String mainComponentName ) {
22
+ super (activity , mainComponentName );
23
+ }
24
+
25
+ @ Override
26
+ protected ReactRootView createRootView () {
27
+ ReactRootView reactRootView = new ReactRootView (getContext ());
28
+ reactRootView .setIsFabric (true );
29
+ return reactRootView ;
30
+ }
31
+ }
32
+
33
+ // Make sure to override the `createReactActivityDelegate()` method.
34
+ @ Override
35
+ protected ReactActivityDelegate createReactActivityDelegate () {
36
+ return new MainActivityDelegate (this , getMainComponentName ());
37
+ }
15
38
}
You can’t perform that action at this time.
0 commit comments