mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Updates from Sat 14 Mar
- Unforked RKWebView | Nick Lockwood
- [ReactNative] Add integration test stuff | Spencer Ahrens
- [ReactNative] AlertIOS.alert and examples | Eric Vicenti
- [react-packager] Implement image loading i.e. ix('img') -> require('image!img'); | Amjad Masad
- Fixed scrollOffset bug | Nick Lockwood
- [React Native] Update 2048 | Alex Akers
- deepDiffer should support explicitly undefined values | Thomas Aylott
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack;
|
||||
- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack;
|
||||
|
||||
- (NSString *)currentErrorMessage;
|
||||
|
||||
- (void)dismiss;
|
||||
|
||||
@end
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
@interface RCTRedBoxWindow : UIWindow <UITableViewDelegate, UITableViewDataSource>
|
||||
|
||||
@property (nonatomic, copy) NSString *lastErrorMessage;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTRedBoxWindow
|
||||
@@ -13,7 +15,6 @@
|
||||
UIView *_rootView;
|
||||
UITableView *_stackTraceTableView;
|
||||
|
||||
NSString *_lastErrorMessage;
|
||||
NSArray *_lastStackTrace;
|
||||
|
||||
UITableViewCell *_cachedMessageCell;
|
||||
@@ -289,6 +290,15 @@
|
||||
|
||||
}
|
||||
|
||||
- (NSString *)currentErrorMessage
|
||||
{
|
||||
if (_window && !_window.hidden) {
|
||||
return _window.lastErrorMessage;
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dismiss
|
||||
{
|
||||
[_window dismiss];
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RCTBridge.h"
|
||||
|
||||
@interface RCTRootView : UIView
|
||||
|
||||
/**
|
||||
@@ -19,13 +21,20 @@
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *moduleName;
|
||||
|
||||
/**
|
||||
* A block that returns an array of pre-allocated modules. These
|
||||
* modules will take precedence over any automatically registered
|
||||
* modules of the same name.
|
||||
*/
|
||||
@property (nonatomic, copy) RCTBridgeModuleProviderBlock moduleProvider;
|
||||
|
||||
/**
|
||||
* The default properties to apply to the view when the script bundle
|
||||
* is first loaded. Defaults to nil/empty.
|
||||
*/
|
||||
@property (nonatomic, copy) NSDictionary *initialProperties;
|
||||
|
||||
/**
|
||||
/**
|
||||
* The class of the RCTJavaScriptExecutor to use with this view.
|
||||
* If not specified, it will default to using RCTContextExecutor.
|
||||
* Changes will take effect next time the bundle is reloaded.
|
||||
|
||||
@@ -142,7 +142,7 @@ static Class _globalExecutorClass;
|
||||
|
||||
// Choose local executor if specified, followed by global, followed by default
|
||||
_executor = [[_executorClass ?: _globalExecutorClass ?: [RCTContextExecutor class] alloc] init];
|
||||
_bridge = [[RCTBridge alloc] initWithExecutor:_executor moduleProvider:nil];
|
||||
_bridge = [[RCTBridge alloc] initWithExecutor:_executor moduleProvider:_moduleProvider];
|
||||
_touchHandler = [[RCTTouchHandler alloc] initWithBridge:_bridge];
|
||||
[self addGestureRecognizer:_touchHandler];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user