I am new to react-native hooks. I am trying to update my array object by whatever the user types in the TextInput field. How can I do it??
where's my state and my folder array object
const [folder, emptyFolder] = useState([]);
Array [
Object {
"id": "0.017859040901406997",
"value": "Bar",
},
]
where's my TextInput. {itemData.item.value} is where I am displaying the name "Bar". I want to update my array with a new array TextInput name. That name is whatever the user enters. Thanks In advance.
const handlePress = () => {
... { map the array[value] an display the new array[value]} ???
};
<FlatList
style={{ margin: 2 }}
data={folderToDisplay}
//keyExtractor={(item) => item.id}
numColumns={4}
renderItem={(itemData) => {
return (
<View style={styles.homeRowFolder}>
<View style={styles.iconAndText}>
<Text style={styles.textdisplay}>
{itemData.item.value}
</Text>
</View>
</View>
);
}}
/>