Skip to content

initialScrollIndex bug #14591

@Symous

Description

@Symous

if I use expression to set initialScrollIndex value , the FlatList will not scroll to the excepted position.

//Not working.
<FlatList
  data = {this.state.items}
  initialScrollIndex = {this.state.items.length > 0 ? 5 : 0 }
  ....
/>

But if I give it a value directly it will scroll to the target index.

//Working.
<FlatList
  data = {this.state.items}
  initialScrollIndex = {5}
  ....
/>

Is it a bug of RN?I catch this with version 0.45.1 Android.

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