question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FlatList] Sometimes FlatList rows are rendered, but not displayed until scroll. RN 0.43

See original GitHub issue

Description

When using FlatList, rows are not displayed though renderItem is called. Rows appear immediately when scroll is triggered on the list.

Reproduction Steps and Sample Code

export default class List extends Component {
  renderItem({item}) {
    return (
      <Text>{item}</Text>
    );
  }

  render() {
    return (
      <FlatList
        style={{
          flex: 1,
          backgroundColor: 'white',
        }}
        data={[1, 2]}
        renderItem={this.renderItem}
      />
    );
  }
}

Solution

FlatList should always display its rendered items.

Additional Information

  • React Native version: 0.43.0
  • Platform: iOS
  • Development Operating System: MacOS
  • Dev tools: Xcode

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:36
  • Comments:78 (27 by maintainers)

github_iconTop GitHub Comments

36reactions
sahrenscommented, Apr 5, 2017

Does setting removeClippedSubviews={false} fix the issue? Sounds like the issue might be related to the navigator which would explain why we don’t see this problem at Facebook. cc @shergin

29reactions
Kiarash-Zcommented, Jun 14, 2017

Hi mine fixed by giving style={{ backgroundColor: 'white' }} to flat list

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native FlatList won't render until I scroll - Stack Overflow
I solved by using this on my FlatList: extraData={this.state} this way, FlatList knows it has to re-render. It's in the docs.
Read more >
ListView doesn't render rows until scroll | Voters - React Native
This problem has been documented on Github in the following issues. It looks to crop up for some ListViews, but not all within...
Read more >
react native flatlist infinite loop - You.com | The AI Search ...
When using FlatList, rows are not displayed though renderItem is called. Rows appear immediately when scroll is triggered on the list. Reproduction Steps...
Read more >
Displaying a List in React Native: Map Method or FlatList ...
FlatList is a React Native component that provides scrolling features by default. ... But you can't see all the data because the list...
Read more >
FlatList - React Native
To render multiple columns, use the numColumns prop. Using this approach instead of a flexWrap layout can prevent conflicts with the item height ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found