-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement ReactNativeFactory (#46298)
Summary: This PR implements ReactNativeFactory to encapsulate further the logic of creating an instance of React Native for iOS. This will remove the strong coupling on the RCTAppDelegate and allow us to support Scene Delegate in the future. The goal is to have a following API: ```objc self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; UIView *rootView = [self.reactNativeFactory.rootViewFactory viewWithModuleName:self.moduleName initialProperties:self.initialProps launchOptions:launchOptions]; // Standard iOS stuff here ``` ## Changelog: [IOS] [ADDED] - implement ReactNativeFactory Pull Request resolved: #46298 Test Plan: Test out all the methods of AppDelegate Reviewed By: huntie Differential Revision: D67451403 Pulled By: cipolleschi fbshipit-source-id: 9e73cd996ffc27ca1e3e058b45fc899b1637bdba
- Loading branch information
1 parent
8b1f049
commit 081be01
Showing
8 changed files
with
514 additions
and
284 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
packages/react-native/Libraries/AppDelegate/RCTAppDelegate+Protected.h
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
21 changes: 21 additions & 0 deletions
21
packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.h
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "RCTReactNativeFactory.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
* Default delegate for RCTReactNativeFactory. | ||
* Contains default implementation of RCTReactNativeFactoryDelegate methods. | ||
*/ | ||
|
||
@interface RCTDefaultReactNativeFactoryDelegate : UIResponder <RCTReactNativeFactoryDelegate> | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.