I have a react-native app, that I want to scroll to top when the FlatList is refreshing in iOS. I can scroll to the top of the FlaList by using:

```
this.componentRef.FlatList.scrollToOffset({x: 0, y: 0, animated: true});

```

Now, the list has Pull-to-refresh on, so I would like to scroll above the refreshing indicator in iOS.

I tried:

```
this.componentRef.FlatList.scrollToOffset({x: 0, y: -20, animated: true});

```

and declaring the RefreshControl with a ref as refreshcontrol (using callback ref declaration):

```
this.componentRef.FlatList.refreshcontrol.scrollToOffset({x: 0, y: 0, animated: true});

```

and

```
this.componentRef.refreshcontrol.scrollToOffset({x: 0, y: 0, animated: true});

```

But none work. Is anyone aware of a way I can scroll above the refreshing indicator, if its on? This only happens in iOS as Android's refreshing indicator works differently.

**UPDATE:**

As scrollToOffset is not available for the RefrehControl component, it won;t work. Which brings me back to how can I scroll above a RefreshControl in a FlatList. My last attempt:

```
this.FlatList.scrollToOffset({x: 0, y: 0, animated: true});

```

Still scrolls to the beginning of the list, yet the "RefreshControl" is visually hidden.

I also tried adding an empty ScrollView above and scrolling to it, because it is empty, it did not work. Any ideas?

**UPDATE 2**

To clarify, this is how everything is called (simplified):

\_scrollAndRefresh method in Main.js:

```
  _scrollAndRefresh = () => {
     this.setState({
       loading: true
     }, () => {
       this.CustomFlatList._scrollToTop();
     });
  }

```

Rendering the component in Main.js:

```
  <CustomFlatList ref={(ref) => {
      this.CustomFlatList = ref}}
    onRefresh={this._handleRefresh} loading={this.state.loading}/>

```

\_handleRefresh method in Main.js:

```
  _handleRefresh = () => {
    this.setState({
      loading: true
    }, () => {
      // REFRESH ACTION
    })
  };

```

\_scrollToTop method CustomFlatList.js:

```
  _scrollToTop = () => {
    if (Platform.OS === 'ios' && this.props.loading) {
      this.FlatList.scrollToOffset({x: 0, y: 0, animated: true});
    }
    else {
      this.FlatList.scrollToOffset({x: 0, y: 0, animated: true});
    }
  }

```

And FlatList CustomFlatList.js:

```
<FlatList
  ref={(ref) => { this.FlatList = ref; }}
  refreshControl={<RefreshControl
            refreshing={this.props.loading}
            onRefresh={this.props.onRefresh}
        />}
/>

```