项目作者: phos-dev

项目描述 :
An editable list component for React Native.
高级语言: JavaScript
项目地址: git://github.com/phos-dev/react-native-editable-list.git
创建时间: 2021-01-24T16:44:28Z
项目社区:https://github.com/phos-dev/react-native-editable-list

开源协议:MIT License

下载


react-native-editable-list

An editable list component for React Native.

NPM JavaScript Style Guide

Install

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

Usage

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

  1. import React, { useState } from 'react';
  2. import { StyleSheet, Text, View, FlatList, TextInput, TouchableOpacity } from 'react-native';
  3. import EditableList from 'react-native-editable-list';
  4. export default function App() {
  5. const [list, setList] = useState([]);
  6. return (
  7. <View style={styles.container}>
  8. <EditableList placeholder='Type something' onListChange={setList.bind(this)} list={list}></EditableList>
  9. <Text style={styles.data}> Data </Text>
  10. <Text> {list.length ? JSON.stringify(list) : 'Please, type something.'} </Text>
  11. </View>
  12. );
  13. }
  14. const styles = StyleSheet.create({
  15. container: {
  16. flex: 1,
  17. backgroundColor: 'yellow',
  18. alignItems: 'center',
  19. justifyContent: 'center',
  20. paddingTop: 40,
  21. paddingBottom: 40
  22. },
  23. data: {
  24. fontSize: 20
  25. }
  26. });

License

MIT © phos-dev