function Four({ navigation, route }) {
const { dateTime } = route.params;
const [name, setName] = useState();
const [note, setNote] = useState();
const [des, setDes] = useState();
const [result, setResult] = useState();
return (
<View>
<TextInput
value={dateTime}
/>
<Text>{'n'}</Text>
<TextInput
placeholder="Enter Event Title"
value={name}
onChangeText={value => {
setResult(value);
setName(value);
}}
/>
<Text>{'n'}</Text>
<TextInput
placeholder="Enter Note"
value={note}
onChangeText={value => {
setNote(value);
setResult(value);
}}
/>
<Text>{'n'}</Text>
<TextInput
placeholder="Enter Description"
value={des}
onChangeText={value => {
setDes(value);
setResult(value);
}}
/>
<Text>{'n'}</Text>
<Button
title="add event"
onPress={() =>
navigation.navigate('three', {
paramKey: dateTime,
paramKey1: name,
paramKey2: note,
paramKey3: des
})
}
/>
</View>
);
}
This is my output
-
I want to like this
-
if I selected 23-12-2022 date this date in the calendar background color change
-
and It didn’t change until I reloaded the app
-
and also if I add a new event then the first event is not removed in flatlist it display all the event when I’m not deleted myself
2
Answers
You can take one state and modify it when click on date for add event and apply it to marked dates.
In the
Three
component,string
to anarray
ofstring
, and adjust the input inCalendar
component.change
to
This way, you can have multiple
markedDates
.What you have to do next is to connect it to your form where you make new event. I can’t help make everything from scratch, so this part need to be from you.