33import android .os .Bundle ;
44import android .view .View ;
55import android .widget .ImageView ;
6-
76import com .facebook .react .ReactActivityDelegate ;
8- import com .facebook .react .ReactRootView ;
9-
7+ import com .facebook .react .defaults . DefaultNewArchitectureEntryPoint ;
8+ import com . facebook . react . defaults . DefaultReactActivityDelegate ;
109import com .reactnativenavigation .NavigationActivity ;
1110
1211import androidx .annotation .Nullable ;
1312
1413public class MainActivity extends NavigationActivity {
1514
15+ @ Override
16+ protected String getMainComponentName () {
17+ return "PlaygroundApp" ;
18+ }
19+
1620 @ Override
1721 protected void onCreate (@ Nullable Bundle savedInstanceState ) {
1822 super .onCreate (savedInstanceState );
@@ -24,4 +28,21 @@ private void setSplashLayout() {
2428 img .setImageDrawable (getDrawable (R .drawable .ic_android ));
2529 setContentView (img );
2630 }
31+
32+ /**
33+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
34+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
35+ * (aka React 18) with two boolean flags.
36+ */
37+ @ Override
38+ protected ReactActivityDelegate createReactActivityDelegate () {
39+ return new DefaultReactActivityDelegate (
40+ this ,
41+ getMainComponentName (),
42+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.
43+ DefaultNewArchitectureEntryPoint .getFabricEnabled (), // fabricEnabled
44+ // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
45+ DefaultNewArchitectureEntryPoint .getConcurrentReactEnabled () // concurrentRootEnabled
46+ );
47+ }
2748}
0 commit comments