From 1fd375576e4e05ee300df32cec6e5e1adf84e3b8 Mon Sep 17 00:00:00 2001 From: Matthew Paravati Date: Wed, 30 Mar 2022 03:32:35 -0400 Subject: [PATCH] fix: `display` prop TypeScript issue (#636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Potential typing BREAKING CHANGE: fix the `display` prop type. It shouldn't be a breaking change, but if you were patching the package this might break your CI so we're releasing it as a breaking change just to be on the safe side :) To verify it, just update to this version and re-run the typecheck script of your app: if it works, you're good to go 👍 --- src/DateTimePickerModal.ios.js | 18 ++++++++++++++++-- typings/index.d.ts | 11 +++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/DateTimePickerModal.ios.js b/src/DateTimePickerModal.ios.js index 22575e0..4152205 100644 --- a/src/DateTimePickerModal.ios.js +++ b/src/DateTimePickerModal.ios.js @@ -248,7 +248,14 @@ export const ConfirmButton = ({ accessibilityRole="button" accessibilityLabel={label} > - {label} + + {label} + ); }; @@ -299,7 +306,14 @@ export const CancelButton = ({ accessibilityRole="button" accessibilityLabel={label} > - {label} + + {label} + ); }; diff --git a/typings/index.d.ts b/typings/index.d.ts index d5272bc..8517b9d 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -37,7 +37,7 @@ export interface DateTimePickerProps { * Default is '#007ff9' */ buttonTextColorIOS?: string; - + /** * The prop to locate cancel button for e2e testing */ @@ -174,7 +174,7 @@ export interface DateTimePickerProps { * * @extends from DatePickerIOSProperties */ - minuteInterval?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30; + minuteInterval?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30; /** * Timezone offset in minutes. @@ -216,9 +216,12 @@ export interface DateTimePickerProps { testID?: string; } +type NativePickerProps = + | Omit + | Omit; + export type ReactNativeModalDateTimePickerProps = DateTimePickerProps & - Omit & - Omit; + NativePickerProps; export default class DateTimePicker extends React.Component< ReactNativeModalDateTimePickerProps,