Fix for Field definition in TypeScript 3.2+

This commit is contained in:
Robert Sargant
2019-02-07 09:32:36 +00:00
parent 0b417416fe
commit c43678fed8
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ export type GenericFieldHTMLAttributes =
SelectHTMLAttributes<HTMLSelectElement> |
TextareaHTMLAttributes<HTMLTextAreaElement>;
export class Field<P = GenericFieldHTMLAttributes | BaseFieldProps> extends Component<BaseFieldProps<P> & P> {
export class Field<P extends GenericFieldHTMLAttributes | BaseFieldProps = GenericFieldHTMLAttributes | BaseFieldProps> extends Component<P> {
dirty: boolean;
name: string;
pristine: boolean;
+6
View File
@@ -287,6 +287,12 @@ const Test = reduxForm<TestFormData>({
component="select"
/>
<Field
name="field4"
component={ MyField }
foo="bar"
/>
<FieldCustom
name="field4"
component={ MyField }