Skip to content

Getting issue in scrollView scrollTo #12739

Closed
@krishbhattacharyya

Description

@krishbhattacharyya

Description

I am using scrollView when fetching data & changing scrollView position with "scrollView.scrollTo". I am getting error like bellow (Sometimes): ( In IOS, it is working )

com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'e.refs.scrollView.scrollTo'), stack:
value@605:5795
@605:6752
..............
............

Reproduction

var self = this;
Api.post(url, data_post, function(response) {
      if(response) {
        // my code updating the scrollView
        ............ 
	self.refs.scrollViewEdit.scrollTo({y: 0});
      }
      self.setState({animating: false });
    });
}

<ScrollView ref='scrollViewEdit'></ScrollView>

Additional Information

  • React Native version: ["0.40.0"]
  • Platform: [Android]
  • Operating System: [Linux]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions