marcocesarato / react-native-big-list

This is a high performance list view for React Native with support for complex layouts using a similar FlatList usage to make easy the replacement. This list implementation for big list rendering on React Native works with a recycler focused on performance and memory usage and so it permits processing thousands items on the list.
https://marcocesarato.github.io/react-native-big-list-docs/
Apache License 2.0
532 stars 43 forks source link

Blank list #100

Open ajoykarmakar opened 3 years ago

ajoykarmakar commented 3 years ago

I follow the example from your project and documentation and got a blank screen.

Code -

import React from 'react';
import {Text} from 'react-native';
import BigList from 'react-native-big-list';

const data = [
  {label: '1', value: 1},
  {label: '2', value: 2},
  {label: '3', value: 3},
  {label: '4', value: 4},
  {label: '5', value: 5},
];
const renderItem = ({item, index}) => (
  <>
    <Text>1</Text>
    <Text>{item.label}</Text>
    <Text>{item.value} </Text>
  </>
);
const renderEmpty = () => <Text>Empty</Text>;
const renderHeader = () => <Text>Header</Text>;
const renderFooter = () => <Text>Footer</Text>;

const HomeScreen = () => {
  return (
    <>
      <Text>hi</Text>
      <BigList
        data={data}
        renderItem={renderItem}
        renderEmpty={renderEmpty}
        renderHeader={renderHeader}
        renderFooter={renderFooter}
        itemHeight={50} // Required (default 0)
        headerHeight={90} // Required to show header
        footerHeight={100} // Required to show footer
      />
    </>
  );
};

export default HomeScreen;

Config -

"dependencies": {
    "react": "17.0.2",
    "react-native": "0.65.2",
    "react-native-big-list": "^1.4.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "7.14.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.66.0",
    "react-native-codegen": "^0.0.7",
    "react-test-renderer": "17.0.2"
  },

Result - Screenshot_1636018402

CrisRonda commented 2 years ago

Same issue in:

"react": "17.0.2",
"react-native": "0.66.1"
"react-native-big-list": "^1.4.3",
joalisonpereira commented 2 years ago

Try use inside a View with flex: 1

lamlengend98 commented 2 years ago

+1 same issue

renderHeader and Footer worked but item is not

dougg0k commented 2 years ago

I had a case of blank list in an app that I am working on, using react-navigation, I had two bottom tab routes, one with the list of collections in Collections Screen (but not only) and the other being the Settings screen, If I entered Settings and got back to collections, the list would be there, but if I entered in another route through Settings, in this case, Accounts Screen route, and got back to Collections after, the list would be blank (only the BigList), every time.

Only fix was to set the Collections screen route to unmount on blur through react-navigation.