Added comment about React Native version support
This commit is contained in:
parent
79540d7cba
commit
5ab7bd96a3
|
@ -31,6 +31,7 @@ JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executor, bool cre
|
||||||
NSMethodSignature *signature = [RCTJavaScriptContext instanceMethodSignatureForSelector:@selector(initWithJSContext:)];
|
NSMethodSignature *signature = [RCTJavaScriptContext instanceMethodSignatureForSelector:@selector(initWithJSContext:)];
|
||||||
assert(signature);
|
assert(signature);
|
||||||
|
|
||||||
|
// React Native 0.14+ expects a JSContext here, but we also support 0.13.x, which takes a JSGlobalContextRef.
|
||||||
if (!strcmp([signature getArgumentTypeAtIndex:2], "@")) {
|
if (!strcmp([signature getArgumentTypeAtIndex:2], "@")) {
|
||||||
JSContext *context = [[JSContext alloc] init];
|
JSContext *context = [[JSContext alloc] init];
|
||||||
rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:(void *)context];
|
rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:(void *)context];
|
||||||
|
|
Loading…
Reference in New Issue