Skip to content

Commit

Permalink
[EuiInlineEdit] Types cleanup
Browse files Browse the repository at this point in the history
- involves removing `children` from EuiInlineEditTitle/Text, but this is definitely more correct in terms of props/typing
  • Loading branch information
cee-chen committed Aug 1, 2023
1 parent 2fa936e commit 95beab1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/components/inline_edit/inline_edit_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ import { useGeneratedHtmlId } from '../../services/accessibility';
import { euiInlineEditReadModeStyles } from './inline_edit_form.styles';

// Props shared between the internal form component as well as consumer-facing components
export type EuiInlineEditCommonProps = HTMLAttributes<HTMLDivElement> &
export type EuiInlineEditCommonProps = Omit<
HTMLAttributes<HTMLDivElement>,
'children'
> &
CommonProps & {
defaultValue: string;
placeholder?: string;
Expand Down Expand Up @@ -90,10 +93,7 @@ export type EuiInlineEditCommonProps = HTMLAttributes<HTMLDivElement> &
};

// Internal-only props, passed by the consumer-facing components
export type EuiInlineEditFormProps = Omit<
EuiInlineEditCommonProps,
'children'
> & {
export type EuiInlineEditFormProps = EuiInlineEditCommonProps & {
/**
* Form sizes
*/
Expand Down
1 change: 0 additions & 1 deletion src/components/inline_edit/inline_edit_text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export type EuiInlineEditTextProps = EuiInlineEditCommonProps & {
};

export const EuiInlineEditText: FunctionComponent<EuiInlineEditTextProps> = ({
children,
className,
size = 'm',
defaultValue,
Expand Down
1 change: 0 additions & 1 deletion src/components/inline_edit/inline_edit_title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export type EuiInlineEditTitleProps = EuiInlineEditCommonProps & {
};

export const EuiInlineEditTitle: FunctionComponent<EuiInlineEditTitleProps> = ({
children,
className,
size = 'm',
heading,
Expand Down

0 comments on commit 95beab1

Please sign in to comment.