skip to Main Content

I have upgraded my React native application to the latest version. App working fin on IOS, but on adnroid getting error ‘ DatePickerAndroid has been removed from React Native’ to react-native-datepicker.
Please suggest if any alternative module is available or we resolve the issue to existing library

 ERROR  Invariant Violation: DatePickerAndroid has been removed from React Native. It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. See https://github.com/react-native-datetimepicker/datetimepicker, js engine: hermes

I had installed another library ‘@react-native-community/datetimepicker’ but it is not the same as
react-native-datepicker. I don’t want to change code as there are multiple conditions to pick the dates

2

Answers


  1. I am using react-native-picker/picker in the apps i work with since RN 0.64 and works really well with both OS

    Login or Signup to reply.
  2. Although @react-native-community/datetimepicker may have some differences compared to react-native-datepicker, it should provide similar functionality for picking dates.

    If you prefer to continue using react-native-datepicker and avoid updating your code, you could consider forking the library and maintaining it yourself. This would involve making the necessary changes to the library to work with the latest version of React Native and addressing the removal of DatePickerAndroid. However, this approach may require significant effort to keep the library up to date and resolve potential issues.

    It’s worth noting that relying on deprecated or outdated libraries can introduce compatibility problems and security risks in the long run. Therefore, it is generally recommended to use @react-native-community/datetimepicker or explore alternative date picker libraries compatible with the latest version of React Native to ensure a stable and maintainable application.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search