-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce RCTHostCreationHelpers (#37328)
Summary: Pull Request resolved: #37328 Changelog: [Internal] in this diff, i introduced a C function to be used to create RCTHost that obfuscates away all the C++ arguments. i expect this to be the API that the vast majority of the community will use to create `RCTHost`. Reviewed By: cipolleschi Differential Revision: D45678970 fbshipit-source-id: e3479db1bb68d93b3ee2f02598413d2080bb5ea9
- Loading branch information
1 parent
2599cc6
commit a320dce
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...ages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHostCreationHelpers.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,29 @@ | ||
/* | ||
* 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 <React/RCTDefines.h> | ||
#import <UIKit/UIKit.h> | ||
|
||
#import "RCTHost.h" | ||
|
||
@class RCTHost; | ||
|
||
@protocol RCTHostDelegate; | ||
@protocol RCTTurboModuleManagerDelegate; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
RCT_EXTERN_C_BEGIN | ||
|
||
RCTHost *RCTHostCreateDefault( | ||
id<RCTHostDelegate> hostDelegate, | ||
id<RCTTurboModuleManagerDelegate> turboModuleManagerDelegate, | ||
RCTHostJSEngineProvider jsEngineProvider); | ||
|
||
RCT_EXTERN_C_END | ||
|
||
NS_ASSUME_NONNULL_END |
19 changes: 19 additions & 0 deletions
19
...ges/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHostCreationHelpers.mm
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,19 @@ | ||
/* | ||
* 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 "RCTHostCreationHelpers.h" | ||
|
||
RCTHost *RCTHostCreateDefault( | ||
id<RCTHostDelegate> hostDelegate, | ||
id<RCTTurboModuleManagerDelegate> turboModuleManagerDelegate, | ||
RCTHostJSEngineProvider jsEngineProvider) | ||
{ | ||
return [[RCTHost alloc] initWithHostDelegate:hostDelegate | ||
turboModuleManagerDelegate:turboModuleManagerDelegate | ||
bindingsInstallFunc:nullptr | ||
jsEngineProvider:jsEngineProvider]; | ||
} |