Skip to content

refactor: remove fabricEnabled argument from DefaultReactActivityDelegate() call in MainActivity.kt since it is deprecated - #248

Merged
cipolleschi merged 2 commits into
react-native-community:mainfrom
zhang-brook:patch-1
Sep 15, 2026
Merged

cipolleschi merged 2 commits into
react-native-community:mainfrom
zhang-brook:patch-1

Conversation

@zhang-brook

@zhang-brook zhang-brook commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary:

DefaultReactActivityDelegate now only needs 2 parameters (activity, mainComponentName).
The 3rd parameter has been marked as @Suppress("UNUSED_PARAMETER"), so the createReactActivityDelegate()
override in MainActivity.kt is unnecessary boilerplate and can be safely removed from the template.

截屏2026-08-26 22 12 38

Changelog:

[ANDROID] [CHANGED] - Remove fabricEnabled argument from DefaultReactActivityDelegate constructor in MainActivity.kt since it is deprecated

@zhang-brook zhang-brook changed the title feat: remove createReactActivityDelegate() override in MainActivity.kt since it is not needed any more feat: remove createReactActivityDelegate() override in MainActivity.kt since it is no longer needed Aug 26, 2026
@cortinico

Copy link
Copy Markdown
Member

We can remove the 3rd param, but not remove the override entirely, because the superclass has a different behavior:

https://github.com/react/react-native/blob/94566e2b892abb55f5fa9d69310373de2a730a89/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java#L54-L56

…gate

The 3rd parameter is no longer required when constructing
DefaultReactActivityDelegate. Keep the override itself to ensure
proper React Native initialization.
@zhang-brook zhang-brook changed the title feat: remove createReactActivityDelegate() override in MainActivity.kt since it is no longer needed refactor: remove fabricEnabled argument from DefaultReactActivityDelegate() call in MainActivity.kt since it is deprecated Aug 26, 2026
@zhang-brook

Copy link
Copy Markdown
Contributor Author

Thanks for the review @cortinico! Updated.

@cipolleschi cipolleschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@cipolleschi
cipolleschi enabled auto-merge (squash) September 15, 2026 12:03
@cipolleschi
cipolleschi merged commit 8475e16 into react-native-community:main Sep 15, 2026
1 check passed
@zhang-brook
zhang-brook deleted the patch-1 branch September 15, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants