Skip to main content

Migrate from react-native-modal-datetime-picker

- <DateTimePickerModal isVisible={open} mode="date" date={date} onConfirm={setDate} onCancel={close} />
+ <DatePickerSheet open={open} value={date} onConfirm={setDate} onOpenChange={close} />
modal-datetime-pickerPatine UI
isVisibleopen
mode="date" | "time" | "datetime"DatePickerSheet · TimePickerSheet · DateTimePickerSheet
datevalue
onConfirm(date)onConfirm(date) (onOpenChange(false) is called right after)
onCancelonOpenChange(false)
confirmTextIOS / cancelTextIOSconfirmLabel / cancelLabel
minimumDate / maximumDateminDate / maxDate

If isVisible was only toggled by a field that shows the date, drop the state and use DatePickerField / TimePickerField / DateTimePickerField with the same props minus visible.

See all migration guides for other libraries, and Comparison for when another library is the better choice.