I am new to React Native and I am trying to edit the user's profile. When I open edit profile screen I get this error:
[Unhandled promise rejection: Invariant Violation: [615,"RNDateTimePicker",21,{"testID":"dateTimePicker","height":34.5,"width":138,"alignSelf":"flex-start","date":"<>","maximumDate":2527282800000,"minimumDate":-628477200000,"mode":"date","onChange":true,"displayIOS":"default","enabled":true}] is not usable as a native method argument]
<TouchableOpacity onPress={() => showMode('date')}>
<View style={{ width: '100%', borderRadius: 8 }}>
{show && (
<DateTimePicker
testID="dateTimePicker"
value={date}
mode={mode}
minimumDate={new Date(1950, 1, 1)}
// maximumDate={moment().subtract(16, 'years').format('YYYY-MM-DDTHH:mm:ss.ssSZ')}
maximumDate={new Date(2050, 1, 1)}
is24Hour={true}
display={'default'}
onChange={onChangeDate}
style={styles.datePicker}
/>
)}
</View>
</TouchableOpacity>
In internet I have found solutions regarding format but everything I've tried hasn't worked so far. Above is my code if anyone can tell what is going wrong. Thanks!