diff --git a/examples/ReactExample/package.json b/examples/ReactExample/package.json index 5bc9e31a..5e4829c6 100644 --- a/examples/ReactExample/package.json +++ b/examples/ReactExample/package.json @@ -7,7 +7,7 @@ }, "dependencies": { "react": "~15.2.0", - "react-native": "^0.29.0", + "react-native": "^0.31.0", "realm": "file:../.." } } diff --git a/react-native/ios/RealmReact/RealmReact.mm b/react-native/ios/RealmReact/RealmReact.mm index 9ffcdd99..0a6c2447 100644 --- a/react-native/ios/RealmReact/RealmReact.mm +++ b/react-native/ios/RealmReact/RealmReact.mm @@ -19,11 +19,13 @@ #import "RealmReact.h" #import "RealmAnalytics.h" #import "RCTBridge.h" +#import "RCTJavaScriptExecutor.h" #import "jsc_init.h" #import "shared_realm.hpp" #import "realm_coordinator.hpp" +#import #import #import #import @@ -44,7 +46,7 @@ using namespace realm::rpc; @interface NSObject () - (instancetype)initWithJSContext:(JSContext *)context; - (instancetype)initWithJSContext:(JSContext *)context onThread:(NSThread *)thread; -- (JSGlobalContextRef)ctx; +- (JSContext *)context; @end extern "C" JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executor, bool create) { @@ -69,7 +71,7 @@ extern "C" JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executo object_setIvar(executor, contextIvar, rctJSContext); } - return [rctJSContext ctx]; + return [rctJSContext context].JSGlobalContextRef; } @interface RealmReact () diff --git a/tests/react-test-app/package.json b/tests/react-test-app/package.json index 2ac3847f..1799ba2c 100644 --- a/tests/react-test-app/package.json +++ b/tests/react-test-app/package.json @@ -7,7 +7,7 @@ }, "dependencies": { "react": "~15.2.0", - "react-native": "^0.29.0", + "react-native": "^0.31.0", "react-native-fs": "^1.1.0", "xmlbuilder": "^4.2.1", "realm": "file:../..",