From 1f64573b4ee0c7f03493a26090f2eaf78ad0ad99 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Mon, 30 Nov 2015 13:48:43 -0800 Subject: [PATCH] Update to support React Native 0.15.0 Resolves #173 --- examples/ReactExample/package.json | 2 +- tests/react-test-app/ios/ReactTests/RealmReactTests.m | 7 +++---- tests/react-test-app/package.json | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/ReactExample/package.json b/examples/ReactExample/package.json index 3e47679b..5cbd2920 100644 --- a/examples/ReactExample/package.json +++ b/examples/ReactExample/package.json @@ -6,7 +6,7 @@ "start": "react-native start" }, "dependencies": { - "react-native": "^0.14.2", + "react-native": "^0.15.0", "realm": "file:../../lib" } } diff --git a/tests/react-test-app/ios/ReactTests/RealmReactTests.m b/tests/react-test-app/ios/ReactTests/RealmReactTests.m index 8d909c7a..b071adfa 100644 --- a/tests/react-test-app/ios/ReactTests/RealmReactTests.m +++ b/tests/react-test-app/ios/ReactTests/RealmReactTests.m @@ -7,10 +7,10 @@ #import "RCTBridge.h" #import "RCTDevMenu.h" -@import ObjectiveC; @import RealmReact; extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSGlobalContextRef ctx, bool includesNativeCallStack); +extern NSMutableArray *RCTGetModuleClasses(void); @interface RealmReactTests : RealmJSTests @end @@ -21,9 +21,8 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG @implementation RealmReactTests + (void)load { - // We don't want the RCTDevMenu from switching the executor class from underneath us. - IMP init = class_getMethodImplementation([NSObject class], @selector(init)); - class_replaceMethod([RCTDevMenu class], @selector(init), init, NULL); + NSMutableArray *moduleClasses = RCTGetModuleClasses(); + [moduleClasses removeObject:[RCTDevMenu class]]; } + (Class)executorClass { diff --git a/tests/react-test-app/package.json b/tests/react-test-app/package.json index e12a3e48..d1e9a1a2 100644 --- a/tests/react-test-app/package.json +++ b/tests/react-test-app/package.json @@ -6,7 +6,7 @@ "start": "react-native start" }, "dependencies": { - "react-native": "^0.14.2", + "react-native": "^0.15.0", "realm": "file:../../lib", "realm-tests": "file:../lib" }