123456789101112131415161718192021222324252627282930313233 |
- import React, { useState } from 'react';
- import {View , Text, TextInput, Button,StyleSheet} from 'react-native';
- import { Icon } from 'react-native-elements'
- export default function TextEditor(props) {
- let [text, setText] = useState(props.text || '');
- let title = props.title || "Input";
- return (
- <View style={styles.container}>
- <Text style={styles.title}>{title}</Text>
- <TextInput style={styles.defaultInput}
- onChangeText={(text) => {
- props.onChange && props.onChange(text);
- setText(text);
- }}
- value={text}/>
- </View>
- );
- }
- const styles = StyleSheet.create({
- container:{
- padding:0,
- borderWidth:1
- },
- defaultInput: {
- },
- title: {
- }
- })
|