Instantly share code, notes, and snippets.
Last active
July 14, 2020 20:26
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save SudoPlz/fffab570dcd9e50b18cf4c27ce6fd05c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/react-native-navigation/ReactNativeNavigation.podspec b/node_modules/react-native-navigation/ReactNativeNavigation.podspec | |
index e960e50..2ad453a 100644 | |
--- a/node_modules/react-native-navigation/ReactNativeNavigation.podspec | |
+++ b/node_modules/react-native-navigation/ReactNativeNavigation.podspec | |
@@ -33,7 +33,5 @@ Pod::Spec.new do |s| | |
end | |
s.dependency 'React' | |
- s.dependency 'React-RCTImage' | |
- s.dependency 'React-RCTText' | |
s.frameworks = 'UIKit' | |
end | |
diff --git a/node_modules/react-native-navigation/lib/android/app/build.gradle b/node_modules/react-native-navigation/lib/android/app/build.gradle | |
index be8a378..08ea7e3 100644 | |
--- a/node_modules/react-native-navigation/lib/android/app/build.gradle | |
+++ b/node_modules/react-native-navigation/lib/android/app/build.gradle | |
@@ -162,7 +162,6 @@ dependencies { | |
implementation 'androidx.appcompat:appcompat:1.1.0' | |
implementation 'androidx.annotation:annotation:1.1.0' | |
- implementation 'com.google.android.material:material:1.2.0-alpha03' | |
implementation 'com.github.wix-playground:ahbottomnavigation:3.2.0' | |
implementation 'com.github.wix-playground:reflow-animator:1.0.6' | |
diff --git a/node_modules/react-native-navigation/lib/ios/RNNBridgeManager.h b/node_modules/react-native-navigation/lib/ios/RNNBridgeManager.h | |
index 34817c6..12a18c2 100644 | |
--- a/node_modules/react-native-navigation/lib/ios/RNNBridgeManager.h | |
+++ b/node_modules/react-native-navigation/lib/ios/RNNBridgeManager.h | |
@@ -5,12 +5,12 @@ typedef UIViewController * (^RNNExternalViewCreator)(NSDictionary* props, RCTBri | |
@interface RNNBridgeManager : NSObject <RCTBridgeDelegate> | |
-- (instancetype)initWithJsCodeLocation:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions bridgeManagerDelegate:(id<RCTBridgeDelegate>)delegate mainWindow:(UIWindow *)mainWindow; | |
+- (instancetype)initWithlaunchOptions:(NSDictionary *)launchOptions andBridgeDelegate:(id<RCTBridgeDelegate>)delegate mainWindow:(UIWindow *)mainWindow; | |
- (void)registerExternalComponent:(NSString *)name callback:(RNNExternalViewCreator)callback; | |
-@property (readonly, nonatomic, strong) RCTBridge *bridge; | |
+- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge; | |
-- (void)setJSCodeLocation:(NSURL *)jsCodeLocation; | |
+@property (readonly, nonatomic, strong) RCTBridge *bridge; | |
@end | |
diff --git a/node_modules/react-native-navigation/lib/ios/RNNBridgeManager.mm b/node_modules/react-native-navigation/lib/ios/RNNBridgeManager.mm | |
index e143f51..f67f979 100644 | |
--- a/node_modules/react-native-navigation/lib/ios/RNNBridgeManager.mm | |
+++ b/node_modules/react-native-navigation/lib/ios/RNNBridgeManager.mm | |
@@ -14,7 +14,7 @@ | |
#import "RNNReactRootViewCreator.h" | |
#import "RNNReactComponentRegistry.h" | |
-@interface RNNBridgeManager() <RCTBridgeDelegate> { | |
+@interface RNNBridgeManager() { | |
#ifdef RN_FABRIC_ENABLED | |
RCTSurfacePresenter *_surfacePresenter; | |
#endif | |
@@ -29,7 +29,6 @@ @interface RNNBridgeManager() <RCTBridgeDelegate> { | |
@end | |
@implementation RNNBridgeManager { | |
- NSURL* _jsCodeLocation; | |
NSDictionary* _launchOptions; | |
id<RCTBridgeDelegate> _delegate; | |
RCTBridge* _bridge; | |
@@ -40,17 +39,16 @@ @implementation RNNBridgeManager { | |
RNNCommandsHandler* _commandsHandler; | |
} | |
-- (instancetype)initWithJsCodeLocation:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions bridgeManagerDelegate:(id<RCTBridgeDelegate>)delegate mainWindow:(UIWindow *)mainWindow { | |
+- (instancetype)initWithlaunchOptions:(NSDictionary *)launchOptions andBridgeDelegate:(id<RCTBridgeDelegate>)delegate mainWindow:(UIWindow *)mainWindow { | |
if (self = [super init]) { | |
_mainWindow = mainWindow; | |
- _jsCodeLocation = jsCodeLocation; | |
_launchOptions = launchOptions; | |
_delegate = delegate; | |
_overlayManager = [RNNOverlayManager new]; | |
_store = [RNNExternalComponentStore new]; | |
- _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:_launchOptions]; | |
+ _bridge = [[RCTBridge alloc] initWithDelegate:delegate launchOptions:_launchOptions]; | |
#ifdef RN_FABRIC_ENABLED | |
_surfacePresenter = [[RCTSurfacePresenter alloc] initWithBridge:_bridge config:nil]; | |
@@ -73,10 +71,6 @@ - (instancetype)initWithJsCodeLocation:(NSURL *)jsCodeLocation launchOptions:(NS | |
return self; | |
} | |
-- (void)setJSCodeLocation:(NSURL *)jsCodeLocation { | |
- _jsCodeLocation = jsCodeLocation; | |
-} | |
- | |
- (void)registerExternalComponent:(NSString *)name callback:(RNNExternalViewCreator)callback { | |
[_store registerExternalComponent:name callback:callback]; | |
} | |
@@ -89,16 +83,6 @@ - (NSArray *)extraModulesFromDelegate { | |
return nil; | |
} | |
-# pragma mark - RCTBridgeDelegate | |
- | |
-- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { | |
- if ([_delegate respondsToSelector:@selector(sourceURLForBridge:)]) { | |
- return [_delegate sourceURLForBridge:bridge]; | |
- } else { | |
- return _jsCodeLocation; | |
- } | |
-} | |
- | |
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge { | |
RNNEventEmitter *eventEmitter = [[RNNEventEmitter alloc] init]; | |
_modalManager = [[RNNModalManager alloc] initWithBridge:bridge]; | |
diff --git a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h | |
index 13db8eb..670c61d 100644 | |
--- a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h | |
+++ b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h | |
@@ -7,18 +7,16 @@ typedef UIViewController * (^RNNExternalViewCreator)(NSDictionary* props, RCTBri | |
@interface ReactNativeNavigation : NSObject | |
-+ (void)bootstrap:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions; | |
++ (void)bootstrapWithlaunchOptions:(NSDictionary *)launchOptions; | |
-+ (void)bootstrap:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions bridgeManagerDelegate:(id<RCTBridgeDelegate>)delegate; | |
- | |
-+ (void)bootstrapWithDelegate:(id<RCTBridgeDelegate>)bridgeDelegate launchOptions:(NSDictionary *)launchOptions; | |
++ (void)bootstrapbootstrapWithLaunchOptions:(NSDictionary *)launchOptions andBridgeDelegate:(id<RCTBridgeDelegate>)bridgeDelegate; | |
+ (void)registerExternalComponent:(NSString *)name callback:(RNNExternalViewCreator)callback; | |
+ (UIViewController *)findViewController:(NSString *)componentId; | |
-+ (void)setJSCodeLocation:(NSURL *)jsCodeLocation; | |
- | |
+ (RCTBridge *)getBridge; | |
++ (NSArray<id<RCTBridgeModule>> *)setupExtraModules:(RCTBridge *)bridge; | |
+ | |
@end | |
diff --git a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.m b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.m | |
index 2f2ce72..cc60640 100644 | |
--- a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.m | |
+++ b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.m | |
@@ -16,16 +16,12 @@ @implementation ReactNativeNavigation | |
# pragma mark - public API | |
-+ (void)bootstrap:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions { | |
- [[ReactNativeNavigation sharedInstance] bootstrap:jsCodeLocation launchOptions:launchOptions]; | |
++ (void)bootstrapWithlaunchOptions:(NSDictionary *)launchOptions { | |
+ [[ReactNativeNavigation sharedInstance] bootstrapbootstrapWithLaunchOptions:launchOptions andBridgeDelegate:nil]; | |
} | |
-+ (void)bootstrap:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions bridgeManagerDelegate:(id<RCTBridgeDelegate>)delegate { | |
- [[ReactNativeNavigation sharedInstance] bootstrap:jsCodeLocation launchOptions:launchOptions bridgeManagerDelegate:delegate]; | |
-} | |
- | |
-+ (void)bootstrapWithDelegate:(id<RCTBridgeDelegate>)bridgeDelegate launchOptions:(NSDictionary *)launchOptions { | |
- [[ReactNativeNavigation sharedInstance] bootstrapWithDelegate:bridgeDelegate launchOptions:launchOptions]; | |
++ (void)bootstrapbootstrapWithLaunchOptions:(NSDictionary *)launchOptions andBridgeDelegate:(id<RCTBridgeDelegate>)bridgeDelegate { | |
+ [[ReactNativeNavigation sharedInstance] bootstrapbootstrapWithLaunchOptions:launchOptions andBridgeDelegate:bridgeDelegate]; | |
} | |
+ (void)registerExternalComponent:(NSString *)name callback:(RNNExternalViewCreator)callback { | |
@@ -40,10 +36,6 @@ + (UIViewController *)findViewController:(NSString *)componentId { | |
return [RNNLayoutManager findComponentForId:componentId]; | |
} | |
-+ (void)setJSCodeLocation:(NSURL *)jsCodeLocation { | |
- [[ReactNativeNavigation sharedInstance].bridgeManager setJSCodeLocation:jsCodeLocation]; | |
-} | |
- | |
# pragma mark - instance | |
+ (instancetype) sharedInstance { | |
@@ -58,18 +50,14 @@ + (instancetype) sharedInstance { | |
return instance; | |
} | |
-- (void)bootstrap:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions { | |
- [self bootstrap:jsCodeLocation launchOptions:launchOptions bridgeManagerDelegate:nil]; | |
+- (void)bootstrapWithLaunchOptions:(NSDictionary *)launchOptions { | |
+ [self bootstrapbootstrapWithLaunchOptions:launchOptions andBridgeDelegate:nil]; | |
} | |
-- (void)bootstrapWithDelegate:(id<RCTBridgeDelegate>)bridgeDelegate launchOptions:(NSDictionary *)launchOptions { | |
- [self bootstrap:nil launchOptions:launchOptions bridgeManagerDelegate:bridgeDelegate]; | |
-} | |
- | |
-- (void)bootstrap:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions bridgeManagerDelegate:(id<RCTBridgeDelegate>)delegate { | |
+- (void)bootstrapbootstrapWithLaunchOptions:(NSDictionary *)launchOptions andBridgeDelegate:(id<RCTBridgeDelegate>)bridgeDelegate { | |
UIWindow* mainWindow = [self initializeKeyWindow]; | |
- self.bridgeManager = [[RNNBridgeManager alloc] initWithJsCodeLocation:jsCodeLocation launchOptions:launchOptions bridgeManagerDelegate:delegate mainWindow:mainWindow]; | |
+ self.bridgeManager = [[RNNBridgeManager alloc] initWithlaunchOptions:launchOptions andBridgeDelegate:bridgeDelegate mainWindow:mainWindow]; | |
[RNNSplashScreen showOnWindow:mainWindow]; | |
} | |
@@ -79,4 +67,8 @@ - (UIWindow *)initializeKeyWindow { | |
return keyWindow; | |
} | |
++ (NSArray<id<RCTBridgeModule>> *)setupExtraModules:(RCTBridge *)bridge { | |
+ return [[ReactNativeNavigation sharedInstance].bridgeManager extraModulesForBridge:bridge]; | |
+} | |
+ | |
@end | |
diff --git a/node_modules/react-native-navigation/lib/ios/UINavigationController+RNNCommands.m b/node_modules/react-native-navigation/lib/ios/UINavigationController+RNNCommands.m | |
index 4d77bc5..3b1702b 100644 | |
--- a/node_modules/react-native-navigation/lib/ios/UINavigationController+RNNCommands.m | |
+++ b/node_modules/react-native-navigation/lib/ios/UINavigationController+RNNCommands.m | |
@@ -83,7 +83,9 @@ - (void)performAnimationBlock:(RNNAnimationBlock)animationBlock completion:(RNNT | |
} | |
}]; | |
- animationBlock(); | |
+ dispatch_async(dispatch_get_main_queue(), ^{ | |
+ animationBlock(); | |
+ }); | |
[CATransaction commit]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment