Skip to content

ScrollView onscroll is not executed at rendering #27215

@SergiuTudos

Description

@SergiuTudos

When I try to render a list of ScollView components I am trying to programmatically scroll using either onContentSizeChange or useEffect nothing happens. According to documentation, it should work.

React Native version:

System:
Binaries:
Node: 10.15.3 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2

Steps To Reproduce

  1. Swipe Hero list to left
  2. Swipe up Hero list

Actual output:
Screen Shot 2019-11-13 at 9 16 35 PM

Expected to happen:
I expect the hero ScrollView to be scrolled and aligned to tiny images
scrollTo in useEffect method should run correctly

useEffect(() => {
scrollView.current.scrollTo({ x: state.big})

  },[state.heroIndex]);

Screen Shot 2019-11-13 at 9 16 42 PM

Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/r1L24RFsB

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions