React native React Native:在JS线程上运行
在iOS中如何在react native的JS线程中执行代码 通过访问reactApplicationContext,我可以在react原生android中执行同样的操作 Android中的:React native React Native:在JS线程上运行,react-native,react-native-android,react-native-ios,React Native,React Native Android,React Native Ios,在iOS中如何在react native的JS线程中执行代码 通过访问reactApplicationContext,我可以在react原生android中执行同样的操作 Android中的: reactApplicationContext.runOnJSQueueThread(new Runnable() { public synchronized void run() { //enter code here } }); 在IOS中:??在对React本机库进行少量挖掘后获得
reactApplicationContext.runOnJSQueueThread(new Runnable() {
public synchronized void run() {
//enter code here
}
});
在IOS中:??在对React本机库进行少量挖掘后获得了它。 在RCTJSCExecutor中找到了executeBlockOnJavaScriptQueue方法:
[mRCTJSCExecutor executeBlockOnJavaScriptQueue:^{
//enter your code
}];