ScrollView should not use RefreshControl on tvOS

Summary:
**Motivation**: On tvOS, Flatview and other components that use ScrollView with a RefreshControl will break without this change.

**Test plan**: Manual testing on tvOS simulator.
Closes https://github.com/facebook/react-native/pull/12751

Differential Revision: D4669503

fbshipit-source-id: 320036571788dc0102ec2611492d0fc97bceb53b
This commit is contained in:
Douglas Lowder 2017-03-09 04:38:21 -08:00 committed by Facebook Github Bot
parent 751addcb73
commit f5585b3d75
1 changed files with 2 additions and 1 deletions

View File

@ -682,9 +682,10 @@ const ScrollView = React.createClass({
if (refreshControl) {
if (Platform.OS === 'ios') {
// On iOS the RefreshControl is a child of the ScrollView.
// tvOS lacks native support for RefreshControl, so don't include it in that case
return (
<ScrollViewClass {...props} ref={this._setScrollViewRef}>
{refreshControl}
{Platform.isTVOS ? null : refreshControl}
{contentContainer}
</ScrollViewClass>
);