Skip to content

Commit 25765fc

Browse files
committed
Fix typescript errors caused by required testID
1 parent c8cb2ec commit 25765fc

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

generatedTypes/src/incubator/TextField/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { FieldContextType as _FieldContextType } from './FieldContext';
1616
import { FloatingPlaceholderProps } from './FloatingPlaceholder';
1717
import { CharCounterProps } from './CharCounter';
1818
export declare type FieldContextType = _FieldContextType;
19-
export declare type TextFieldProps = MarginModifiers & PaddingModifiers & TypographyModifiers & ColorsModifiers & InputProps & LabelProps & FloatingPlaceholderProps & ValidationMessageProps & Omit<CharCounterProps, 'maxLength'> & {
19+
export declare type TextFieldProps = MarginModifiers & PaddingModifiers & TypographyModifiers & ColorsModifiers & InputProps & LabelProps & Omit<FloatingPlaceholderProps, 'testID'> & ValidationMessageProps & Omit<CharCounterProps, 'maxLength' | 'testID'> & {
2020
/**
2121
* Pass to render a leading element
2222
*/

generatedTypes/src/incubator/TextField/usePreset.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
2222
formatter?: ((value?: string | undefined) => string | undefined) | undefined;
2323
children?: import("react").ReactNode;
2424
style?: import("react-native").StyleProp<import("react-native").TextStyle>;
25-
testID: string;
25+
testID?: string | undefined;
2626
removeClippedSubviews?: boolean | undefined;
2727
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
2828
onContentSizeChange?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputContentSizeChangeEventData>) => void) | undefined;
@@ -145,8 +145,8 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
145145
validationMessagePosition?: import("./types").ValidationMessagePosition | undefined;
146146
floatingPlaceholder?: boolean | undefined;
147147
floatingPlaceholderColor?: import("./types").ColorType | undefined;
148-
floatingPlaceholderStyle?: ((false | import("react-native").TextStyle | import("react-native").RegisteredStyle<import("react-native").TextStyle> | import("react-native").RecursiveArray<import("react-native").TextStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").TextStyle>> | null) & import("react-native").TextStyle) | undefined;
149148
floatOnFocus?: boolean | undefined;
149+
floatingPlaceholderStyle?: ((false | import("react-native").TextStyle | import("react-native").RegisteredStyle<import("react-native").TextStyle> | import("react-native").RecursiveArray<import("react-native").TextStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").TextStyle>> | null) & import("react-native").TextStyle) | undefined;
150150
extraOffset?: number | undefined;
151151
enableErrors?: boolean | undefined;
152152
validationMessage?: string | string[] | undefined;
@@ -423,7 +423,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
423423
formatter?: ((value?: string | undefined) => string | undefined) | undefined;
424424
children?: import("react").ReactNode;
425425
style?: import("react-native").StyleProp<import("react-native").TextStyle>;
426-
testID: string;
426+
testID?: string | undefined;
427427
removeClippedSubviews?: boolean | undefined;
428428
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
429429
onContentSizeChange?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputContentSizeChangeEventData>) => void) | undefined;
@@ -546,8 +546,8 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
546546
validationMessagePosition?: import("./types").ValidationMessagePosition | undefined;
547547
floatingPlaceholder?: boolean | undefined;
548548
floatingPlaceholderColor?: import("./types").ColorType | undefined;
549-
floatingPlaceholderStyle?: ((false | import("react-native").TextStyle | import("react-native").RegisteredStyle<import("react-native").TextStyle> | import("react-native").RecursiveArray<import("react-native").TextStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").TextStyle>> | null) & import("react-native").TextStyle) | undefined;
550549
floatOnFocus?: boolean | undefined;
550+
floatingPlaceholderStyle?: ((false | import("react-native").TextStyle | import("react-native").RegisteredStyle<import("react-native").TextStyle> | import("react-native").RecursiveArray<import("react-native").TextStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").TextStyle>> | null) & import("react-native").TextStyle) | undefined;
551551
extraOffset?: number | undefined;
552552
enableErrors?: boolean | undefined;
553553
validationMessage?: string | string[] | undefined;
@@ -936,7 +936,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
936936
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
937937
includeFontPadding?: boolean | undefined;
938938
} | null;
939-
testID: string;
939+
testID?: string | undefined;
940940
removeClippedSubviews?: boolean | undefined;
941941
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
942942
onContentSizeChange?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputContentSizeChangeEventData>) => void) | undefined;
@@ -1067,6 +1067,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
10671067
error: any;
10681068
disabled: string;
10691069
};
1070+
floatOnFocus?: boolean | undefined;
10701071
floatingPlaceholderStyle: ((false | import("react-native").TextStyle | import("react-native").RegisteredStyle<import("react-native").TextStyle> | import("react-native").RecursiveArray<import("react-native").TextStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").TextStyle>> | null) & import("react-native").TextStyle) | {
10711072
color?: import("react-native").ColorValue | undefined;
10721073
fontFamily?: string | undefined;
@@ -1180,7 +1181,6 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
11801181
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
11811182
includeFontPadding?: boolean | undefined;
11821183
};
1183-
floatOnFocus?: boolean | undefined;
11841184
extraOffset?: number | undefined;
11851185
enableErrors: boolean;
11861186
validationMessage?: string | string[] | undefined;

src/incubator/TextField/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ export type TextFieldProps = MarginModifiers &
3939
ColorsModifiers &
4040
InputProps &
4141
LabelProps &
42-
FloatingPlaceholderProps &
42+
Omit<FloatingPlaceholderProps, 'testID'> &
4343
// We're declaring these props explicitly here for react-docgen (which can't read hooks)
4444
// FieldStateProps &
4545
ValidationMessageProps &
46-
Omit<CharCounterProps, 'maxLength'> & {
46+
Omit<CharCounterProps, 'maxLength' | 'testID'> & {
4747
/**
4848
* Pass to render a leading element
4949
*/

0 commit comments

Comments
 (0)