Flashscrollindicators - how to use in scrollview

I’m using scrollview and noticed in the react native docs you can use the method flashscrollindicators, but there are no examples of how this would be done. Does anybody have any example I might learn from? Thanks

When there is a method on a component, you call it by getting a reference to the component instance using the special ref prop.

class X extends React.Component {
  render() {
    return <ScrollView ref={this._setScrollView} />;
  }

  _setScrollView = scrollView => {
    // NOTE: scrollView will be null when the component is unmounted
    this._scrollView = scrollView;
  };

  _onSomeEvent = () => {
    if (this._scrollView) {
      this._scrollView.flashScrollIndicators();
    }
  };
}

Read this, too: https://reactjs.org/docs/refs-and-the-dom.html

Thanks…this is very helpful

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.