import React, { useState } from 'react'; import {View, Text, TextInput, StyleSheet} from 'react-native'; export default function ActionEditor(props) { let [action, setAction] = useState(props.action || {}); if(!action.data || typeof action.data !== "object") action.data = {}; return ( Type { action.type = text; props.onChange && props.onChange(action); setAction(action); }} value={action.type}/> Data { action.data.route = text; props.onChange && props.onChange(action); setAction(action); }} value={action.data.route}/> ); } const styles = StyleSheet.create({ container:{ padding:24, paddingTop: 0, flexDirection: 'column' }, row: { flexDirection: 'row', alignItems: 'baseline', justifyContent: 'space-between', }, capFirst: { fontSize: 14, fontFamily: 'roboto-light', textTransform: 'capitalize' }, defaultInput: { marginTop:6, borderWidth:1, backgroundColor: 'white', boxShadow: '0px 3px 6px #00000029', borderColor: '#FFFFFF66', borderRadius: 14 }, title: { } })