1.0.18 • Published 2 years ago

@idiosync/horizontal-flatlist v1.0.18

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

NPM Version

React Native Horizontal FlatList

Provides the ability to specify number of rows to a horizontal React Native FlatList

Installation

yarn:

$ yarn add @idiosync/horizontal-flatlist

npm:

$ npm i @idiosync/horizontal-flatlist

Usage

import { HorizontalFlatList } from '@idiosync/horizontal-flatlist'

const SomeComponent = () => {
  const data = [
    'one',
    'two',
    'three',
    'four',
    'five',
    'six'
  ]

  const renderItem = ({item, row, col}) => {
    <Text>{item}</Text>
  }

  const keyExtractor = (item, row, col) => item 
 
  return (
    <HorizontalFlatList
      data={data}
      numRows={2}
      keyExtractor={keyExtractor}
      renderItem={renderItem}
    />
  )
}

Props

Props are inherited form FlatListProps, but with the following changes:

  • renderItem - Overidden to include the column number
({ item: ItemT, row: number, col: number}) => JSX.Element
  • keyExtractor - Overidden to include the column number
(item: ItemT, row: number, col: number) => string
  • numRows - Number of items in each column
  • columnStyle - ViewStyle for the column view

  • horizontal - Removed

  • numColumns - Removed

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago