Skip to content

Commit 1fd3755

Browse files
fix: display prop TypeScript issue (#636)
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 👍
1 parent 48e9b61 commit 1fd3755

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

src/DateTimePickerModal.ios.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,14 @@ export const ConfirmButton = ({
248248
accessibilityRole="button"
249249
accessibilityLabel={label}
250250
>
251-
<Text style={[style.text, buttonTextColorIOS && { color: buttonTextColorIOS }]}>{label}</Text>
251+
<Text
252+
style={[
253+
style.text,
254+
buttonTextColorIOS && { color: buttonTextColorIOS },
255+
]}
256+
>
257+
{label}
258+
</Text>
252259
</TouchableHighlight>
253260
);
254261
};
@@ -299,7 +306,14 @@ export const CancelButton = ({
299306
accessibilityRole="button"
300307
accessibilityLabel={label}
301308
>
302-
<Text style={[style.text, buttonTextColorIOS && { color: buttonTextColorIOS }]}>{label}</Text>
309+
<Text
310+
style={[
311+
style.text,
312+
buttonTextColorIOS && { color: buttonTextColorIOS },
313+
]}
314+
>
315+
{label}
316+
</Text>
303317
</TouchableHighlight>
304318
);
305319
};

typings/index.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface DateTimePickerProps {
3737
* Default is '#007ff9'
3838
*/
3939
buttonTextColorIOS?: string;
40-
40+
4141
/**
4242
* The prop to locate cancel button for e2e testing
4343
*/
@@ -174,7 +174,7 @@ export interface DateTimePickerProps {
174174
*
175175
* @extends from DatePickerIOSProperties
176176
*/
177-
minuteInterval?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30;
177+
minuteInterval?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30;
178178

179179
/**
180180
* Timezone offset in minutes.
@@ -216,9 +216,12 @@ export interface DateTimePickerProps {
216216
testID?: string;
217217
}
218218

219+
type NativePickerProps =
220+
| Omit<IOSNativeProps, "value" | "mode">
221+
| Omit<AndroidNativeProps, "value" | "mode">;
222+
219223
export type ReactNativeModalDateTimePickerProps = DateTimePickerProps &
220-
Omit<IOSNativeProps, "value" | "mode" | "onChange"> &
221-
Omit<AndroidNativeProps, "value" | "mode" | "onChange">;
224+
NativePickerProps;
222225

223226
export default class DateTimePicker extends React.Component<
224227
ReactNativeModalDateTimePickerProps,

0 commit comments

Comments
 (0)