Showing list empty message at the center of the screen in a FlatList using ListHeaderComponent

Hope this will help you

<FlatList
    contentContainerStyle={{ flexGrow: 1 }}
    disableVirtualization={false}
    data={this.state.data}
    renderItem={this.renderItem}
    ListEmptyComponent={this.renderEmptyContainer()}
      />
    }
  />

Place your UI in the renderEmptyContainer() method and boom, Empty container will show up whenever your list is empty

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)