Skip to content

ScrollToLocation does not work on nested SectionList #25295

@aleixo

Description

@aleixo

I cannot use the reference method ScrollToLocation on a nested Section List. It will always give me error saying that this._scrollRef.scrollTo is not a function. (In 'this._scrollRef.scrollTo(o?{x:y,animated:p}:{y:y,animated:p})', 'this._scrollRef.scrollTo' is undefined). I am using RN 0.59.9.

React Native version:

info
React Native Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 2.98 GB / 7.87 GB
Binaries:
Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5522156

Steps To Reproduce

  • Using the provided expo
  1. Click on one not bold item.
  • No using the provided expo
  1. Setup one SectionList component
  2. On the section List renderItem, render another SectionList component
  3. On the second secondList, capture its reference
  4. Call scrollToLocation method of the second sectionlist on renderItem click.

E expect the list to scroll to the index provided on the section provided

Snack, code example, or link to a repository:

https://snack.expo.io/@daleixo/sectionlist-bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugComponent: SectionListStaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions