-
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.
Summary: 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`. Differential Revision: D45678970 fbshipit-source-id: d3610b641498e17e628d8e346990dc346145b6b9
- Loading branch information
1 parent
b0c2e2a
commit 6154224
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...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,22 @@ | ||
/* | ||
* 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> | ||
|
||
@class RCTHost; | ||
|
||
@protocol RCTHostDelegate; | ||
@protocol RCTTurboModuleManagerDelegate; | ||
|
||
RCT_EXTERN_C_BEGIN | ||
|
||
RCTHost *RCTHostCreateDefault( | ||
id<RCTHostDelegate> hostDelegate, | ||
id<RCTTurboModuleManagerDelegate> turboModuleManagerDelegate); | ||
|
||
RCT_EXTERN_C_END |
26 changes: 26 additions & 0 deletions
26
...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,26 @@ | ||
/* | ||
* 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" | ||
|
||
#import <ReactCommon/RCTHermesInstance.h> | ||
#import <react/bridgeless/ReactInstance.h> | ||
|
||
#import "RCTHost.h" | ||
|
||
RCTHost *RCTHostCreateDefault( | ||
id<RCTHostDelegate> hostDelegate, | ||
id<RCTTurboModuleManagerDelegate> turboModuleManagerDelegate) | ||
{ | ||
return [[RCTHost alloc] initWithHostDelegate:hostDelegate | ||
turboModuleManagerDelegate:turboModuleManagerDelegate | ||
bindingsInstallFunc:nullptr | ||
jsErrorHandlingFunc:nullptr | ||
jsEngineProvider:^std::shared_ptr<facebook::react::JSEngineInstance>() { | ||
return std::make_shared<facebook::react::RCTHermesInstance>(); | ||
}]; | ||
} |