react-native-editable-list

1.0.3 • Public • Published

react-native-editable-list

An editable list component for React Native.

NPM JavaScript Style Guide

Install

npm install --save react-native-editable-list

Usage

https://snack.expo.io/@phos-dev/react-native-editable-list

import React, { useState } from 'react';
import { StyleSheet, Text, View, FlatList, TextInput, TouchableOpacity } from 'react-native';
import EditableList from 'react-native-editable-list';

export default function App() {
  const [list, setList] = useState([]);
  return (
    <View style={styles.container}>
	  <EditableList placeholder='Type something' onListChange={setList.bind(this)} list={list}/>
	  <Text style={styles.data}> Data </Text>
	  <Text> {list.length ? JSON.stringify(list) : 'Please, type something.'} </Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'yellow',
    alignItems: 'center',
    justifyContent: 'center',
    paddingTop: 40,
    paddingBottom: 40
  },
  data: {
      fontSize: 20
  }
});

License

MIT © phos-dev

Package Sidebar

Install

npm i react-native-editable-list

Weekly Downloads

18

Version

1.0.3

License

MIT

Unpacked Size

21.7 kB

Total Files

6

Last publish

Collaborators

  • phos-dev