mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-14 12:11:47 +08:00
Allow init of Native Module before bridge is initialized [2/N]
Summary: This may be controversial. Right now, RelayPrefetcher is initialized [here](https://fburl.com/p01iunr1), after bridge is initialized. I want to create a FBRelayPrefetcherModule instance eagerly (diff 3 in stack), and then pass that into the bridge module registry. This way, native side gets to use RelayPrefetcher before bridge is init, and JS still accesses the same instance of FBRelayPrefetcherModule. The only other option is drastically change bridge init, to allow passing in some eagerly initialized instances. Reviewed By: shergin Differential Revision: D13164277 fbshipit-source-id: b45111cd68d78820e61e4fca7e54a7e8df32a3f0
This commit is contained in:
committed by
Facebook Github Bot
parent
fd78eee11b
commit
18f3de9dce
@@ -69,7 +69,7 @@ typedef id<RCTBridgeModule>(^RCTBridgeModuleProvider)(void);
|
||||
* if it has not already been created. To check if the module instance exists
|
||||
* without causing it to be created, use `hasInstance` instead.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) id<RCTBridgeModule> instance;
|
||||
@property (nonatomic, strong, readwrite) id<RCTBridgeModule> instance;
|
||||
|
||||
/**
|
||||
* Returns the module method dispatch queue. Note that this will init both the
|
||||
|
||||
Reference in New Issue
Block a user