'React native react-native-date-picker date not working?
I am picking a date with the react native date picker, date sims to update but not showing on the date picker it self...
TNX in advanced Harel
const [selectedStartDate, setSelectedStartDate] = useState(null);
const [selectedEndDate, setSelectedEndDate] = useState(null);
const onDateChange = (date, type) => {
//function to handle the date change
if (type === 'END_DATE') {
setSelectedEndDate(date);
} else {
setSelectedEndDate(null);
setSelectedStartDate(date);
}
};
<ScrollView contentInsetAdjustmentBehavior="automatic">
<View>
<Text style={styles.highlight}>Home screen</Text>
<View style={styles.container}>
<CalendarPicker onDateChange={onDateChange} />
<View>
<Text>SELECTED DATE:{startDate}</Text>
</View>
</View>
</View>
</ScrollView>;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
