mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Updates from Tue 31 Mar
- Bugfix/require module regexp | Amjad Masad - [ReactNative] RCTView's shadowOffset is of float type, not CGFloat | Kevin Gozali - Fix WebView automaticallyAdjustContentInsets error | Spencer Ahrens - [react-native] map view - add onTouch** props | Jiajie Zhu - [react-native] Fix documentation extraction for View | Ben Alpert - [ReactNative] Add few hints in the UI | Alex Kotliarskyi - Adding `scrollWithoutAnimationTo` method for ScrollViews | Felix Oghina - [ScrollView] Add "bounces" property to ScrollView propTypes | Spencer Ahrens - Fix a crash in RCTAsyncLocalStorage when the value is not a string. | Spencer Ahrens - [ReactNative] Remove global MutationObserver to fix Bluebird feature detection | Christopher Chedeau - [catalyst] fix typo | Jiajie Zhu - [react-packager] check-in bluebird | Amjad Masad - [react-native] v0.3.1 | Amjad Masad - [Pod] Preserve header directory structure | Alex Akers - [react-native] Bring React.render behavior in line with web | Ben Alpert - Expose html prop on WebView | Spencer Ahrens - missing '.' in ListView.DataSource example | Christopher Chedeau - [react-native] Support returning null from a component | Ben Alpert - [react-native] Fix race condition in removeSubviewsFromContainerWithID: | Ben Alpert
This commit is contained in:
@@ -157,7 +157,7 @@ static dispatch_queue_t RCTFileQueue(void)
|
||||
return RCTMakeAndLogError(@"Entries must be arrays of the form [key: string, value: string], got: ", entry, nil);
|
||||
}
|
||||
if (![entry[1] isKindOfClass:[NSString class]]) {
|
||||
return RCTMakeAndLogError(@"Values must be strings, got: ", entry[1], entry[0]);
|
||||
return RCTMakeAndLogError(@"Values must be strings, got: ", entry[1], @{@"key": entry[0]});
|
||||
}
|
||||
NSString *key = entry[0];
|
||||
id errorOut = RCTErrorForKey(key);
|
||||
|
||||
@@ -507,7 +507,7 @@ static NSString *RCTViewNameForModuleName(NSString *moduleName)
|
||||
{
|
||||
RCT_EXPORT();
|
||||
|
||||
id<RCTViewNodeProtocol> container = _viewRegistry[containerID];
|
||||
id<RCTViewNodeProtocol> container = _shadowViewRegistry[containerID];
|
||||
RCTAssert(container != nil, @"container view (for ID %@) not found", containerID);
|
||||
|
||||
NSUInteger subviewsCount = [[container reactSubviews] count];
|
||||
@@ -1051,13 +1051,27 @@ static void RCTMeasureLayout(RCTShadowView *view,
|
||||
[self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry){
|
||||
UIView *view = viewRegistry[reactTag];
|
||||
if ([view conformsToProtocol:@protocol(RCTScrollableProtocol)]) {
|
||||
[(id<RCTScrollableProtocol>)view scrollToOffset:CGPointMake([offsetX floatValue], [offsetY floatValue])];
|
||||
[(id<RCTScrollableProtocol>)view scrollToOffset:CGPointMake([offsetX floatValue], [offsetY floatValue]) animated:YES];
|
||||
} else {
|
||||
RCTLogError(@"tried to scrollToOffset: on non-RCTScrollableProtocol view %@ with tag %@", view, reactTag);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)scrollWithoutAnimationToOffsetWithView:(NSNumber *)reactTag scrollToOffsetX:(NSNumber *)offsetX offsetY:(NSNumber *)offsetY
|
||||
{
|
||||
RCT_EXPORT(scrollWithoutAnimationTo);
|
||||
|
||||
[self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry){
|
||||
UIView *view = viewRegistry[reactTag];
|
||||
if ([view conformsToProtocol:@protocol(RCTScrollableProtocol)]) {
|
||||
[(id<RCTScrollableProtocol>)view scrollToOffset:CGPointMake([offsetX floatValue], [offsetY floatValue]) animated:NO];
|
||||
} else {
|
||||
RCTLogError(@"tried to scrollToOffset: on non-RCTScrollableProtocol view %@ with tag %@", view, reactTag);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)zoomToRectWithView:(NSNumber *)reactTag rect:(NSDictionary *)rectDict
|
||||
{
|
||||
RCT_EXPORT(zoomToRect);
|
||||
|
||||
@@ -79,7 +79,7 @@ RCT_REMAP_VIEW_PROPERTY(testID, accessibilityIdentifier, NSString)
|
||||
RCT_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat)
|
||||
RCT_REMAP_VIEW_PROPERTY(shadowColor, layer.shadowColor, CGColor);
|
||||
RCT_REMAP_VIEW_PROPERTY(shadowOffset, layer.shadowOffset, CGSize);
|
||||
RCT_REMAP_VIEW_PROPERTY(shadowOpacity, layer.shadowOpacity, CGFloat)
|
||||
RCT_REMAP_VIEW_PROPERTY(shadowOpacity, layer.shadowOpacity, float)
|
||||
RCT_REMAP_VIEW_PROPERTY(shadowRadius, layer.shadowRadius, CGFloat)
|
||||
RCT_REMAP_VIEW_PROPERTY(transformMatrix, layer.transform, CATransform3D)
|
||||
RCT_CUSTOM_VIEW_PROPERTY(overflow, css_overflow, RCTView)
|
||||
|
||||
@@ -73,6 +73,11 @@
|
||||
[_webView loadRequest:[NSURLRequest requestWithURL:URL]];
|
||||
}
|
||||
|
||||
- (void)setHTML:(NSString *)HTML
|
||||
{
|
||||
[_webView loadHTMLString:HTML baseURL:nil];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
}
|
||||
|
||||
RCT_REMAP_VIEW_PROPERTY(url, URL, NSURL);
|
||||
RCT_REMAP_VIEW_PROPERTY(html, HTML, NSString);
|
||||
RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets);
|
||||
RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, UIEdgeInsets);
|
||||
RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(shouldInjectAJAXHandler, BOOL);
|
||||
|
||||
- (NSDictionary *)constantsToExport
|
||||
|
||||
Reference in New Issue
Block a user