Я пробовал setstate, но он не работает. Это мой код, пожалуйста, помогите мне сохранить данные, принятые из textinput, на листе Excel ... Я не хочу отображать его где-либо. но сохраните данные на листе Excel. Я попытался установить xlsx, но смог понять, как писать в коде.
const Description = props => {
const {title} =props.navigation.state.params;
const [item, setItem] = useState('');
const [brand,setBrand] = useState('');
const [color,setColor] = useState('');
const [date,setdate] = useState('');
const [loc,setLoc] = useState('');
const [addi,setAdd] = useState('');
return <View style={styles.background}>
<Text style={styles.text}> You are a hero! {"\n"}
Enter The Details of the Item {title} </Text>
<ScrollView style={styles.scroll}>
<View style={styles.box}>
<Text style={styles.textStyle}> Description</Text>
<View style={styles.back}>
<AntDesign name="QQ" style={styles.icon} />
<Text> </Text>
<TextInput value={item}
onChangeText={(newTerm) => setItem(newTerm)}
style={styles.input}
placeholder={"Enter the Name"}
onEditEditing={()=>console.log('term was submitted')}
/>
</View>
.... Точно так же для других входных данных я взял входы ....
_retrieveData = async () => {
try {
const value = await AsyncStorage.getItem(item);
if (value !== null) {
// We have data!!
console.log(value);
}
} catch (error) {
// Error retrieving data
}
};
</View>
</ScrollView>
</View>
};
помогите пожалуйста, что я могу сделать .... и да, это expo cli