Skip to content

Commit

Permalink
delete DEPRECATED_sendUpdatedChildFrames prop from ScrollView
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[iOS][Removed] - Removed DEPRECATED_sendUpdatedChildFrames prop to ScrollView component because there are no callsites of it anymore

Reviewed By: shergin

Differential Revision: D21941946

fbshipit-source-id: 0b7d6d0986ddff4b250e70e0450a6f7e166b41f4
  • Loading branch information
ZHUANGPP authored and facebook-github-bot committed Jun 9, 2020
1 parent a28a52d commit 345d0c1
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 26 deletions.
13 changes: 0 additions & 13 deletions Libraries/Components/ScrollView/ScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,6 @@ type IOSProps = $ReadOnly<{|
| 'never'
| 'always'
),
/**
* When true, ScrollView will emit updateChildFrames data in scroll events,
* otherwise will not compute or emit child frame data. This only exists
* to support legacy issues, `onLayout` should be used instead to retrieve
* frame data.
* The default value is false.
* @platform ios
*/
DEPRECATED_sendUpdatedChildFrames?: ?boolean,
|}>;

type AndroidProps = $ReadOnly<{|
Expand Down Expand Up @@ -1147,9 +1138,6 @@ class ScrollView extends React.Component<Props, State> {
? this.props.alwaysBounceVertical
: !this.props.horizontal;

const DEPRECATED_sendUpdatedChildFrames = !!this.props
.DEPRECATED_sendUpdatedChildFrames;

const baseStyle =
this.props.horizontal === true
? styles.baseHorizontal
Expand Down Expand Up @@ -1197,7 +1185,6 @@ class ScrollView extends React.Component<Props, State> {
this.props.onMomentumScrollBegin || this.props.onMomentumScrollEnd
? true
: false,
DEPRECATED_sendUpdatedChildFrames,
// default to true
snapToStart: this.props.snapToStart !== false,
// default to true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export type ScrollViewNativeProps = $ReadOnly<{
snapToOffsets?: ?$ReadOnlyArray<number>,
snapToStart?: ?boolean,
zoomScale?: ?number,
DEPRECATED_sendUpdatedChildFrames?: ?boolean,
// Overrides
style?: {...ViewStyleProp, ...} | DangerouslyImpreciseStyle,
onResponderGrant?: ?(e: any) => void | boolean,
Expand Down
2 changes: 0 additions & 2 deletions Libraries/Components/ScrollView/ScrollViewViewConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ const ScrollViewViewConfig = {
snapToOffsets: true,
snapToStart: true,
zoomScale: true,

DEPRECATED_sendUpdatedChildFrames: true,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ exports[`<ScrollView /> should render as expected: should deep render when mocke

exports[`<ScrollView /> should render as expected: should deep render when not mocked (please verify output manually) 1`] = `
<RCTScrollView
DEPRECATED_sendUpdatedChildFrames={false}
alwaysBounceVertical={true}
onContentSizeChange={null}
onLayout={[Function]}
Expand Down
9 changes: 1 addition & 8 deletions React/Views/ScrollView/RCTScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
#endif

_automaticallyAdjustContentInsets = YES;
_DEPRECATED_sendUpdatedChildFrames = NO;
_contentInset = UIEdgeInsetsZero;
_contentSize = CGSizeZero;
_lastClippedToRect = CGRectNull;
Expand Down Expand Up @@ -593,13 +592,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
*/
if (_allowNextScrollNoMatterWhat ||
(_scrollEventThrottle > 0 && _scrollEventThrottle < MAX(0.017, now - _lastScrollDispatchTime))) {
if (_DEPRECATED_sendUpdatedChildFrames) {
// Calculate changed frames
RCT_SEND_SCROLL_EVENT(onScroll, (@{@"updatedChildFrames" : [self calculateChildFramesData]}));
} else {
RCT_SEND_SCROLL_EVENT(onScroll, nil);
}

RCT_SEND_SCROLL_EVENT(onScroll, nil);
// Update dispatch time
_lastScrollDispatchTime = now;
_allowNextScrollNoMatterWhat = NO;
Expand Down
1 change: 0 additions & 1 deletion React/Views/ScrollView/RCTScrollViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ - (UIView *)view
RCT_EXPORT_VIEW_PROPERTY(onScrollEndDrag, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onMomentumScrollBegin, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onMomentumScrollEnd, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(DEPRECATED_sendUpdatedChildFrames, BOOL)
RCT_EXPORT_VIEW_PROPERTY(inverted, BOOL)
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
RCT_EXPORT_VIEW_PROPERTY(contentInsetAdjustmentBehavior, UIScrollViewContentInsetAdjustmentBehavior)
Expand Down

0 comments on commit 345d0c1

Please sign in to comment.