mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
448db78a88
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/29453 Problem Statement: A native module needs to call a function on `ReactInstance` (in this case `loadScript`). Typically, this is handled by the bridge. Current Bridgeless Solution: Create a new protocol (in this case `RCTJSScriptLoaderModule`) which lets a block be passed in TM init to forward the method call to `ReactInstance`. This is the best thing I could think of right now. Changelog:[Internal] Reviewed By: RSNara Differential Revision: D22512748 fbshipit-source-id: e6559279b6e299e17d1199407129ad3902c41e6b
19 lines
541 B
Objective-C
19 lines
541 B
Objective-C
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
@class RCTSource;
|
|
|
|
/**
|
|
* This protocol should be adopted when a turbo module needs to tell React Native to load a script.
|
|
* In bridge-less React Native, it is a replacement for [_bridge loadAndExecuteSplitBundleURL:].
|
|
*/
|
|
@protocol RCTJSScriptLoaderModule <NSObject>
|
|
|
|
@property (nonatomic, copy, nonnull) void (^loadScript)(RCTSource *source);
|
|
|
|
@end
|