0.0.3 • Published 9 months ago

react-native-section-list v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

React Native Section List

The react-native-section-list package is a library for React Native applications that simplifies the rendering and handling of lists. It provides a customizable component, SectionList, which allows you to display and iterate through a list of items, along with optional heading and item rendering functionalities.

React Native SectionList Example

Installation

Download the package with npm or yarn

npm install react-native-section-list

In order for react-native-section-list to work, you also need to install the moment

npm install moment  

Usage

import SectionList from 'react-native-section-list';
 <SectionList
        jsonKey={'category'}
        isDate={true}
        containerStyle={styles.container}
        childContainerStyle={undefined}
        data={DATA}
        renderHeading={(title) => (
          <Text style={styles.headerText}>{title}</Text>
        )}
        renderItem={({ item, index }: { item: any; index?: number }) => (
          <Text key={index}>{JSON.stringify(item)}</Text>
        )}
      />

Props

All the FlatList props can be passed.

PropTypeDescription
jsonKeystringExtracts unique identifiers from the data (Required)
isDatebooleanindicates whether to sort data by date.
containerStyleViewStyleStyling for the main container that holds the list.
childContainerStyleViewStyleAdditional styling for the child container that wraps
renderHeadingReact.FC<any>renders each item in the list .
dataArray<any>An array of data to render in the FlatList (Required)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago