Added comment about React Native version support

This commit is contained in:
Scott Kyle 2015-11-13 11:21:55 -08:00
parent 79540d7cba
commit 5ab7bd96a3
1 changed files with 1 additions and 0 deletions

View File

@ -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];