{
const classes = classNames(
@@ -82,8 +88,9 @@ export const EuiFlexGrid: FunctionComponent<
);
return (
-
+ // @ts-ignore
+
{children}
-
+
);
};
diff --git a/src/components/flex/flex_item.test.tsx b/src/components/flex/flex_item.test.tsx
index d035f14774e..4a05e7d8900 100644
--- a/src/components/flex/flex_item.test.tsx
+++ b/src/components/flex/flex_item.test.tsx
@@ -6,7 +6,7 @@ import {
stopThrowingReactWarnings,
} from '../../test';
-import { EuiFlexItem, FlexItemComponentType, GROW_SIZES } from './flex_item';
+import { EuiFlexItem, GROW_SIZES } from './flex_item';
beforeAll(startThrowingReactWarnings);
afterAll(stopThrowingReactWarnings);
@@ -27,26 +27,4 @@ describe('EuiFlexItem', () => {
});
});
});
-
- describe('component', () => {
- (['div', 'span', 'figure'] as FlexItemComponentType[]).forEach(value => {
- test(`${value} is rendered`, () => {
- const component = render(
);
-
- expect(component).toMatchSnapshot();
- });
- });
-
- ['h2'].forEach(value => {
- test(`${value} is not rendered`, () => {
- expect(() =>
- render(
- // intentionally passing an invalid value
- // @ts-ignore
-
- )
- ).toThrow();
- });
- });
- });
});
diff --git a/src/components/flex/flex_item.tsx b/src/components/flex/flex_item.tsx
index 046cffa1391..e3c5cdb3e96 100644
--- a/src/components/flex/flex_item.tsx
+++ b/src/components/flex/flex_item.tsx
@@ -16,11 +16,10 @@ export type FlexItemGrowSize =
| true
| false
| null;
-export type FlexItemComponentType = 'div' | 'span' | 'figure';
export interface EuiFlexItemProps {
grow?: FlexItemGrowSize;
- component?: FlexItemComponentType;
+ component?: keyof JSX.IntrinsicElements;
}
export const GROW_SIZES: FlexItemGrowSize[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
@@ -49,6 +48,7 @@ export const EuiFlexItem: FunctionComponent<
);
return (
+ // @ts-ignore
{children}
diff --git a/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap b/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap
index 7c5dbeffbc1..b26ca92ce1b 100644
--- a/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap
+++ b/src/components/form/described_form_group/__snapshots__/described_form_group.test.js.snap
@@ -38,6 +38,7 @@ exports[`EuiDescribedFormGroup is rendered 1`] = `
describedByIds={Array []}
display="row"
fullWidth={false}
+ hasChildLabel={true}
hasEmptyLabelSpace={false}
labelType="label"
>
@@ -77,6 +78,7 @@ exports[`EuiDescribedFormGroup props description is not rendered when it's not p
describedByIds={Array []}
display="row"
fullWidth={false}
+ hasChildLabel={true}
hasEmptyLabelSpace={false}
labelType="label"
>
@@ -125,6 +127,7 @@ exports[`EuiDescribedFormGroup props fullWidth is rendered 1`] = `
describedByIds={Array []}
display="row"
fullWidth={true}
+ hasChildLabel={true}
hasEmptyLabelSpace={false}
labelType="label"
>
@@ -173,6 +176,7 @@ exports[`EuiDescribedFormGroup props gutterSize is rendered 1`] = `
describedByIds={Array []}
display="row"
fullWidth={false}
+ hasChildLabel={true}
hasEmptyLabelSpace={false}
labelType="label"
>
@@ -221,6 +225,7 @@ exports[`EuiDescribedFormGroup props titleSize is rendered 1`] = `
describedByIds={Array []}
display="row"
fullWidth={false}
+ hasChildLabel={true}
hasEmptyLabelSpace={false}
labelType="label"
>
@@ -321,6 +326,7 @@ exports[`EuiDescribedFormGroup ties together parts for accessibility 1`] = `
]
}
fullWidth={false}
+ hasChildLabel={true}
hasEmptyLabelSpace={false}
helpText="Help text"
isInvalid={true}
@@ -329,7 +335,6 @@ exports[`EuiDescribedFormGroup ties together parts for accessibility 1`] = `
>
@@ -15,7 +16,6 @@ exports[`EuiFormRow behavior onBlur is called in child 1`] = `
>
@@ -64,7 +65,6 @@ exports[`EuiFormRow behavior onBlur works in parent even if not in child 1`] = `
>
@@ -113,7 +114,6 @@ exports[`EuiFormRow behavior onFocus is called in child 1`] = `
>
@@ -162,7 +163,6 @@ exports[`EuiFormRow behavior onFocus works in parent even if not in child 1`] =
>