Skip to content

Commit

Permalink
Re-enable Fabric in the default app template/RN-Tester (#36717)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
cortinico authored and facebook-github-bot committed Mar 30, 2023
1 parent 66ae98e commit e5dd9cd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.facebook.react.defaults

import android.os.Bundle
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.ReactRootView
Expand Down Expand Up @@ -43,4 +44,7 @@ open class DefaultReactActivityDelegate(

override fun createRootView(): ReactRootView =
ReactRootView(context).apply { setIsFabric(fabricEnabled) }

override fun createRootView(bundle: Bundle): ReactRootView =
ReactRootView(context).apply { setIsFabric(fabricEnabled) }
}

0 comments on commit e5dd9cd

Please sign in to comment.