From 36cfa69123c0f9c40b7570767cd0d4f91dfca416 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Mon, 16 Mar 2026 13:01:21 +0100 Subject: [PATCH] feat(android)!: remove deprecated positiveButtonLabel, negativeButtonLabel, neutralButtonLabel props BREAKING CHANGE: The deprecated `positiveButtonLabel`, `negativeButtonLabel`, and `neutralButtonLabel` props have been removed. Use `positiveButton`, `negativeButton`, and `neutralButton` instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 25 ------------------------- src/DateTimePickerAndroid.android.js | 6 ------ src/androidUtils.js | 10 ---------- src/datetimepicker.android.js | 6 ------ src/index.d.ts | 12 ------------ src/types.js | 12 ------------ 6 files changed, 71 deletions(-) diff --git a/README.md b/README.md index 50a6c86e..68a4a40f 100644 --- a/README.md +++ b/README.md @@ -568,31 +568,6 @@ Set the negative button label and text color. ``` -#### `positiveButtonLabel` (`optional`, `Android only`, deprecated) - -Changes the label of the positive button. - -```js - -``` - -#### `negativeButtonLabel` (`optional`, `Android only`, deprecated) - -Changes the label of the negative button. - -```js - -``` - -#### `neutralButtonLabel` (`optional`, `Android only`, deprecated) - -Allows displaying neutral button on picker dialog. -Pressing button can be observed in onChange handler as `event.type === 'neutralButtonPressed'` - -```js - -``` - #### `minuteInterval` (`optional`) The interval at which minutes can be selected. diff --git a/src/DateTimePickerAndroid.android.js b/src/DateTimePickerAndroid.android.js index de2b13f3..8ed335b8 100644 --- a/src/DateTimePickerAndroid.android.js +++ b/src/DateTimePickerAndroid.android.js @@ -42,9 +42,6 @@ function open(props: AndroidNativeProps) { positiveButton, negativeButton, neutralButton, - neutralButtonLabel, - positiveButtonLabel, - negativeButtonLabel, testID, firstDayOfWeek, title, @@ -63,17 +60,14 @@ function open(props: AndroidNativeProps) { try { const dialogButtons = { positive: { - label: positiveButtonLabel, ...positiveButton, textColor: processColor(positiveButton?.textColor), }, neutral: { - label: neutralButtonLabel, ...neutralButton, textColor: processColor(neutralButton?.textColor), }, negative: { - label: negativeButtonLabel, ...negativeButton, textColor: processColor(negativeButton?.textColor), }, diff --git a/src/androidUtils.js b/src/androidUtils.js index ff5399c4..f815c344 100644 --- a/src/androidUtils.js +++ b/src/androidUtils.js @@ -121,16 +121,6 @@ function validateAndroidProps(props: AndroidNativeProps) { !(display === ANDROID_DISPLAY.clock && mode === ANDROID_MODE.date), `display: ${display} and mode: ${mode} cannot be used together.`, ); - if ( - props?.positiveButtonLabel !== undefined || - props?.negativeButtonLabel !== undefined || - props?.neutralButtonLabel !== undefined - ) { - console.warn( - 'positiveButtonLabel, negativeButtonLabel and neutralButtonLabel are deprecated.' + - 'Use positive / negative / neutralButton prop instead.', - ); - } } function validateMaterial3PropsNotUsed(props: AndroidNativeProps) { diff --git a/src/datetimepicker.android.js b/src/datetimepicker.android.js index 9f9a4278..3bf75f0b 100644 --- a/src/datetimepicker.android.js +++ b/src/datetimepicker.android.js @@ -28,9 +28,6 @@ export default function RNDateTimePickerAndroid( positiveButton, negativeButton, neutralButton, - positiveButtonLabel, - negativeButtonLabel, - neutralButtonLabel, testID, firstDayOfWeek, title, @@ -64,9 +61,6 @@ export default function RNDateTimePickerAndroid( positiveButton, negativeButton, neutralButton, - positiveButtonLabel, - negativeButtonLabel, - neutralButtonLabel, testID, firstDayOfWeek, title, diff --git a/src/index.d.ts b/src/index.d.ts index 2f58e27b..451f3e63 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -165,18 +165,6 @@ export type AndroidNativeProps = Readonly< neutralButton?: ButtonType; negativeButton?: ButtonType; - /** - * @deprecated use neutralButton instead - * */ - neutralButtonLabel?: string; - /** - * @deprecated use positiveButton instead - * */ - positiveButtonLabel?: string; - /** - * @deprecated use negativeButton instead - * */ - negativeButtonLabel?: string; /** * Sets the first day of the week shown in the calendar */ diff --git a/src/types.js b/src/types.js index a7ab3282..94c9cb22 100644 --- a/src/types.js +++ b/src/types.js @@ -237,18 +237,6 @@ export type AndroidNativeProps = $ReadOnly<{| // Not supported in Material 3 pickers neutralButton?: ButtonType, negativeButton?: ButtonType, - /** - * @deprecated use neutralButton instead - * */ - neutralButtonLabel?: string, - /** - * @deprecated use positiveButton instead - * */ - positiveButtonLabel?: string, - /** - * @deprecated use negativeButton instead - * */ - negativeButtonLabel?: string, /** * Sets the first day of the week shown in the calendar */