Skip to content

0.16.11

Compare
Choose a tag to compare
@Purii Purii released this 29 Aug 13:52

New features

  • Separated Separator component, to support rendering through FlatList. Affects Section - a0c68c9.
import React from 'react';
import { FlatList } from 'react-native';

import { Cell, Separator, TableView } from 'react-native-tableview-simple';

const data = [
  { id: 1, title: '1' },
  { id: 2, title: '2' },
  { id: 3, title: '3' },
  { id: 4, title: '4' },
];

export default (ExampleWithFlatList = () =>
  <FlatList
    extraData={this.state}
    data={data}
    keyExtractor={(item, index) => item.id}
    renderItem={({ item, separators }) =>
      <Cell
        title={item.title}
        onPress={console.log}
        onHighlightRow={separators.highlight}
        onUnHighlightRow={separators.unhighlight}
      />}
    ItemSeparatorComponent={({ highlighted }) =>
      <Separator isHidden={highlighted} />}
  />);