Skip to content

Commit c89237c

Browse files
cortinicojeongshin
authored andcommitted
Re-enable Fabric in the default app template/RN-Tester (facebook#36717)
Summary: Pull Request resolved: facebook#36717 After D43711737 landed, it turns out that Fabric is always disabled for both RN-Tester and new app from template (so for 0.72 also RC0). The reason is that a new method `createRootView(Bundle)` was introduced inside `ReactActivityDelegate`. Both RN Tester and the template were using the old `createRootView()` method which is not called anymore at this stage (should potentially be deprecated?). This diff fixes it by overriding both method inside `DefaultReactActivityDelegate` so that both methods are setting the Fabric renderer. Changelog: [Android] [Fixed] - Re-enable Fabric in the default app template/RN-Tester Reviewed By: cipolleschi Differential Revision: D44536222 fbshipit-source-id: d22a0c522f011a8fe4d27b5d8f2fcf5dd13c3058
1 parent 20d781a commit c89237c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package com.facebook.react.defaults
99

10+
import android.os.Bundle
1011
import com.facebook.react.ReactActivity
1112
import com.facebook.react.ReactActivityDelegate
1213
import com.facebook.react.ReactRootView
@@ -43,4 +44,7 @@ open class DefaultReactActivityDelegate(
4344

4445
override fun createRootView(): ReactRootView =
4546
ReactRootView(context).apply { setIsFabric(fabricEnabled) }
47+
48+
override fun createRootView(bundle: Bundle): ReactRootView =
49+
ReactRootView(context).apply { setIsFabric(fabricEnabled) }
4650
}

0 commit comments

Comments
 (0)