Skip to content

onChange deprecated warning when using onConfirm/onCancel props #792

Description

@nesho84

Environment

  • react-native-modal-datetime-picker: 18.0.0
  • @react-native-community/datetimepicker: (latest)
  • Expo SDK: 56
  • React Native: 0.79
  • Platform: Android & iOS

Description
When using react-native-modal-datetime-picker with the standard onConfirm and onCancel props, the following warning appears in the console:

WARN DateTimePicker: onChange is deprecated. Use onValueChange, onDismiss, and onNeutralButtonPress instead.

The warning comes from inside the library itself — not from user code. The underlying @react-native-community/datetimepicker deprecated onChange in favor of onValueChange, onDismiss, and onNeutralButtonPress, but react-native-modal-datetime-picker still uses onChange internally.

Expected behavior
No deprecation warning when using the library normally.

Possible fix
Replace the internal usage of onChange with onValueChange + onDismiss in the wrapper component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions