mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-23 21:10:01 +00:00
revert to creating the context manullay for all react-native versions
This commit is contained in:
parent
3b75de4554
commit
67cdae387e
@ -60,17 +60,17 @@ extern "C" JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executo
|
|||||||
NSMethodSignature *signature = [RCTJavaScriptContext instanceMethodSignatureForSelector:@selector(initWithJSContext:onThread:)];
|
NSMethodSignature *signature = [RCTJavaScriptContext instanceMethodSignatureForSelector:@selector(initWithJSContext:onThread:)];
|
||||||
if (signature) {
|
if (signature) {
|
||||||
// for RN 0.28.0+
|
// for RN 0.28.0+
|
||||||
rctJSContext = [executor context];
|
rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:[JSContext new] onThread:[NSThread currentThread]];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// for RN < 0.28.0
|
// for RN < 0.28.0
|
||||||
NSMethodSignature *oldSignature = [RCTJavaScriptContext instanceMethodSignatureForSelector:@selector(initWithJSContext:)];
|
NSMethodSignature *oldSignature = [RCTJavaScriptContext instanceMethodSignatureForSelector:@selector(initWithJSContext:)];
|
||||||
assert(oldSignature);
|
assert(oldSignature);
|
||||||
|
|
||||||
rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:[[JSContext alloc] init]];
|
rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:[JSContext new]];
|
||||||
object_setIvar(executor, contextIvar, rctJSContext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object_setIvar(executor, contextIvar, rctJSContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [rctJSContext ctx];
|
return [rctJSContext ctx];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user