I am not sure if this is an error from my code or it's from the react-native-datetimepicker
.
Here's how I am using it in my code:
{show && (
<>
<DateTimePicker
value={date}
mode={mode}
is24Hour={true}
onChange={dateOnChange}
/>
<Button
title="Submit"
onPress={() => {
setShow(false);
}}
/>
</>
)}
show
is a state, controlled by its mother component. When it's true, the DateTimePicker
will show.
Here's a more detailed log of the bug: