Skip to content

Commit 3363dd2

Browse files
committed
fix: remove children check in form field
1 parent 5857dd2 commit 3363dd2

3 files changed

Lines changed: 5 additions & 14 deletions

File tree

src/components/FormField/FormField.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import * as React from 'react';
33
import { Box } from '../Layout';
44
import { Label, Text } from '../Typography';
55

6-
export interface FormFieldProps<TChildren = any> {
6+
export interface FormFieldProps {
77
error?: string;
88
label?: string;
99
description?: string;
10-
children?: TChildren;
1110
}
1211

1312
const FormField = (props: FormFieldProps) => {
1413
const {
1514
label,
1615
error,
17-
children = null,
16+
// @ts-ignore
17+
children,
1818
description,
1919
...passThroughProps
2020
} = props;

src/components/SelectList/SelectListField.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import * as React from 'react';
33
import { withTheme } from '../../theme';
44
import { FormField, FormFieldProps } from '../FormField';
55
import SelectList, { SelectListProps } from './SelectList';
6-
import { SelectListItemBaseProps } from './SelectListItem';
76

8-
export interface SelectListFieldProps
9-
extends FormFieldProps<Array<React.ReactElement<SelectListItemBaseProps>>>,
10-
SelectListProps {}
7+
export interface SelectListFieldProps extends FormFieldProps, SelectListProps {}
118

129
const SelectListFieldBase = (props: SelectListFieldProps) => {
1310
const { label, error, description, ...passThroughProps } = props;

src/components/TextInput/TextInput.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,7 @@ class TextInputBase extends React.Component<TextInputProps> {
5050
};
5151

5252
public handleOnFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
53-
const {
54-
isDisabled = false,
55-
isInvalid = false,
56-
onFocus,
57-
theme,
58-
size = 'medium',
59-
} = this.props;
53+
const { isDisabled = false, onFocus } = this.props;
6054
const { inputStyle, focusedStyle } = this.getStyles();
6155

6256
if (!isDisabled) {

0 commit comments

Comments
 (0)