Fix redundant styles on RefreshControl for Android
Summary: Fixed a bug that RefreshControl wrongly apply redundant styles on Android, this solves #10742 Closes https://github.com/facebook/react-native/pull/10899 Differential Revision: D4176670 fbshipit-source-id: 357bfd726a39fe8e79d4d70ddfdfd1d39034620e
This commit is contained in:
parent
9a8b5d9f4f
commit
39c18186e1
|
@ -531,10 +531,13 @@ const ScrollView = React.createClass({
|
|||
// On Android wrap the ScrollView with a AndroidSwipeRefreshLayout.
|
||||
// Since the ScrollView is wrapped add the style props to the
|
||||
// AndroidSwipeRefreshLayout and use flex: 1 for the ScrollView.
|
||||
// Note: we should only apply props.style on the wrapper
|
||||
// however, the ScrollView still needs the baseStyle to be scrollable
|
||||
|
||||
return React.cloneElement(
|
||||
refreshControl,
|
||||
{style: props.style},
|
||||
<ScrollViewClass {...props} ref={this._setScrollViewRef}>
|
||||
<ScrollViewClass {...props} style={baseStyle} ref={this._setScrollViewRef}>
|
||||
{contentContainer}
|
||||
</ScrollViewClass>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue