import React, { useEffect } from 'react'; import { StyleSheet, Text, View, TextInput, Pressable } from 'react-native'; import DepenseForm from './depense_edit/depense_form'; export default function DepenseListEntry(props){ const [editing, toggleEdit] = React.useState(false); return( { toggleEdit(!editing); console.log(props.depense); }} style={depense_list_entry_style.pressable_depense_list_entry}> {props.depense.description} {new Date(props.depense.date).toDateString()} {props.depense.value} {editing ? {toggleEdit(res)}} depense={props.depense}/> : } ) } const depense_list_entry_style = StyleSheet.create({ depense_list_entry: { borderBottomWidth: 0.5 }, pressable_depense_list_entry: { display: "flex", flexDirection: "row", justifyContent: "space-between", margin: 2, } });