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
525 stars 41 forks source link

Stabilize the unstable empty component. #296

Closed HyopeR closed 1 year ago

HyopeR commented 1 year ago

Simply put, making EmptyComponent more flexible. The following 3 parameters can cause EmptyComponent to take different styles.

hideMarginalsOnEmpty
hideHeaderOnEmpty
hideFooterOnEmpty

To solve this follow a way as HeaderComponent or FooterComponent is created. The style we give to renderEmpty or ListEmptyComponent will be one-to-one consistent.

For example;

<BigList
    data={[]}
    renderItem={() => <View />}
    itemHeight={50}
    style={{flexGrow: 1}}
    contentContainerStyle={{flexGrow: 1}}
    renderEmpty={() => {
        // It cannot fill the page. This situation has been corrected.
        return (
            <View style={{flexGrow: 1, backgroundColor: 'red'}} />
        )
    }}
/>

Correction of the previously closed issue: https://github.com/marcocesarato/react-native-big-list/issues/83

HyopeR commented 1 year ago

@marcocesarato can you check?