mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
Add context executor API for sync hooks
Summary: public This exposes a proper API for adding synchronous callbacks to JS, as an optional feature of the executor. This is based on nicklockwood's work in D2764492, but avoids refactoring bridge/executor interactions for the time being, since we agree on this API and can move the actual callsites around later. Reviewed By: nicklockwood Differential Revision: D2799506 fb-gh-sync-id: af209d9a0be927f3404205feb16e59745cc37aec
This commit is contained in:
committed by
facebook-github-bot-7
parent
1c1d7006c2
commit
a5d82c2823
@@ -187,7 +187,7 @@ RCT_EXPORT_METHOD(test:(__unused NSString *)a
|
||||
moduleProvider:nil
|
||||
launchOptions:nil];
|
||||
id executor = [bridge.batchedBridge valueForKey:@"javaScriptExecutor"];
|
||||
RUN_RUNLOOP_WHILE(!(weakContext = [executor valueForKey:@"context"]));
|
||||
RUN_RUNLOOP_WHILE(!(weakContext = [executor valueForKey:@"_context"]));
|
||||
XCTAssertNotNil(weakContext, @"RCTJavaScriptContext should have been created");
|
||||
(void)bridge;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user