Skip to content

JoaoBGusmao/react-easy-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-easy-list

THIS LIB IS NOT DONE YET

Easy list system based on ReactNative's FlatList API

NPM JavaScript Style Guide

Why

The final objective of this lib is to build simple lists without dealing with maps, keys, last item and empty list logics

Install

npm install --save react-easy-list

Usage

import React from 'react'
import EaseList from 'react-easy-list'

const Example = () => {
  <EasyList
    data={[
      { id: 1, title: 'Hello', content: 'World' },
      { id: 2, title: 'World', content: 'Hello' },
    ]}
    renderItem={({ title, content }) => (
      <>
        <h1>{title}</h1>
        <h2>{content}</h2>
      </>
    )}
    ListHeaderComponent={<p>---- This is the beginning ----</p>}
    ListFooterComponent={<p>---- This is the end ----</p>}
  />
}

License

MIT © JoaoBGusmao