feat: migrate to SceneDelegate#53744
Open
artus9033 wants to merge 67 commits into
Open
Conversation
…eDelegate and AppDelegate
…ifecycle-originating updates from DeviceEventEmitter
…ensure devtools will log it too
…ts and animating the container transform, drop RCTResizeThrottler
cipolleschi
marked this pull request as ready for review
February 4, 2026 11:10
cipolleschi
marked this pull request as draft
February 4, 2026 11:10
Introduces an optional RCTSceneDelegate base class alongside the existing RCTAppDelegate path, with RCTGetActiveReactNativeFactory and RCTKeyWindow improvements.
Adopt RCTSceneDelegate in sample apps, wire push notifications on AppDelegate for the scene path, fix native example views to use RCTGetActiveReactNativeFactory, and preserve legacy AppDelegate bootstrap behind compile flags.
artus9033
force-pushed
the
feat/scene-delegate
branch
from
July 9, 2026 15:29
e2482e9 to
a0b8944
Compare
artus9033
marked this pull request as ready for review
July 13, 2026 10:12
artus9033
force-pushed
the
feat/scene-delegate
branch
from
July 13, 2026 11:19
abf677c to
d5a5a6d
Compare
cipolleschi
requested changes
Jul 13, 2026
cipolleschi
left a comment
Contributor
There was a problem hiding this comment.
Hi @artus9033, thanks for working on this.
The PR is very detailed and well prepared.
I think we can simplify some assumption to make it smaller and more maintainable.
I left some comments in the PR. Could you address them?
artus9033
force-pushed
the
feat/scene-delegate
branch
from
July 13, 2026 15:27
27e1c80 to
49816a3
Compare
…le to disable New Arch
…ports" This reverts commit c77f68a.
cipolleschi
approved these changes
Jul 23, 2026
cipolleschi
left a comment
Contributor
There was a problem hiding this comment.
Thanks for fixing this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This PR introduces a migration from the now-deprecated iOS AppDelegate to SceneDelegate, as well as the changes to React Native code that will migrate to APIs allowing it to work fine with the SceneDelegate approach. There are two primary goals of this API:
The changes are additive to RN and maintain backwards compatibility, but require user-space modifications to RN apps that want to migrate from AppDelegate to the scene lifecycle.
What changed
Bootstrap (
Libraries/AppDelegate)RCTSceneDelegate- introduced fast integration point for subclassing in the user-space SceneDelegate base class (counterpart toRCTAppDelegate)RCTReactNativeFactory- SceneDelegate entrypoints viaUISceneConnectionOptionsRCTAppDelegateretained; deprecation wording updated to point scene apps toRCTSceneDelegateUtilities (
React/Base)RCTGetActiveReactNativeFactory()- resolve factory from SceneDelegate or AppDelegateRCTKeyWindow()- iOS 13–14 fallback for scene-based appsRCTIsSceneDelegateApp()- dual-path linking detectionLinking (
Libraries/LinkingIOS)RCTLinkingManager; AppDelegate methods retained for non-scene appsCore modules
RCTDeviceInfo- refresh cachedgetConstants()on orientation/frame/content-size changesNativeDeviceInfoJS - remove stale constants cachingRCTDevLoadingView- layout/dismiss fixes for scene window resizingSample apps
RCTSceneDelegate; AppDelegate handles push notificationsRNTESTER_USE_APPDELEGATEAppDelegate.legacy.swiftThe RFC documenting the details is available here.
Example usage:
An example entrypoint using the added
RCTSceneDelegate(imported fromReact_RCTAppDelegate) is:Follow-ups:
After merging this PR, the AppDelegate will be deprecated, but still available. After a future de-integration of AppDelegate,
packages/react-native/Libraries/AppDelegateand contained files should be renamed.Additional information
One capability that can be leveraged with the SceneDelegate on iPadOS is multi-window (multi-instance) support, which would cause all sorts of problems in the current React Native core and 3p libraries' designs. Therefore, enabling this capability is currently unsupported by React Native and to enforce this, a warning message like the one below would be printed provided this capability had been enabled:
Changelog:
[IOS] [ADDED] - SceneDelegate support with backwards compatibility to AppDelegate-only approaches
[IOS] [ADDED] -
RCTSceneDelegate,RCTGetActiveReactNativeFactory(), andRCTReactNativeFactorySceneDelegate entrypoints[IOS] [ADDED] -
RCTLinkingManagerSceneDelegate lifecycle methods (AppDelegate path retained)[IOS] [CHANGED] - DeviceInfo to update the value returned by getConstants upon frame change
[IOS] [CHANGED] - RCTDevLoadingView layout for scene window resizing
[IOS] [ADDED] - additional scheme: RNTester (AppDelegate), allowing to run RNTester with AppDelegate infrastructure
[IOS] [ADDED] - print warning from RCTReactNativeFactory if
UIApplicationSceneManifest.UIApplicationSupportsMultipleScenesin Info.plist is set to true, which is unsupported by RN to prevent bugs due to simultaneously running multiple instances of an appTest Plan:
RNTesterSceneDelegate andRNTester (AppDelegate)schemes)RNTester
ScreenRecording_07-13-2026.12-26-27_1.mov
HelloWorld
ScreenRecording_07-13-2026.13-15-08_1.mov