Skip to main content
Version: v0.23.2

Migrate from react-native-modal-datetime-picker

- <DateTimePickerModal isVisible={open} mode="date" date={date} onConfirm={setDate} onCancel={close} />
+ <DatePickerSheet visible={open} value={date} onConfirm={setDate} onClose={close} />
modal-datetime-pickerReact Native Pickers
isVisiblevisible
mode="date" | "time" | "datetime"DatePickerSheet · TimePickerSheet · DateTimePickerSheet
datevalue
onConfirm(date)onConfirm(date) (onClose is called right after)
onCancelonClose
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.