DatePickerIOS Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefin
petervn opened this issue · comments
Bug report
import { DatePickerIOS } from "@react-native-community/datetimepicker";
///
<DatePickerIOS
date={this.state.date}
mode={mode}
minimumDate={minDate && this.getDate(minDate)}
maximumDate={maxDate && this.getDate(maxDate)}
onDateChange={this.onDateChange}
minuteInterval={minuteInterval}
timeZoneOffsetInMinutes={
timeZoneOffsetInMinutes
? timeZoneOffsetInMinutes
: null
}
style={[Style.datePicker, customStyles.datePicker]}
locale={locale}
/> */}
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefin
Summary
Reproducible sample code
Steps to reproduce
- …
- …
Describe what you expected to happen:
- …
- …
Environment info
npx react-native info
output:
# paste it here
Time zone name (If the problem you have is related to unexpected time / date. See list in https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
datetimepicker version: x.x.x
iOS / Android version: x.x
Hello 👋🏼
Please use default import :)
Can you try
import DatePicker from "@react-native-community/datetimepicker";