Skip to content

Commit f00a6a4

Browse files
authored
[Flyout System] Avoid making breaking type changes (#9139)
1 parent 87af8c3 commit f00a6a4

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/eui/src/components/flyout/flyout.component.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ interface _EuiFlyoutComponentProps {
7575
/**
7676
* A required callback function fired when the flyout is closed.
7777
*/
78-
onClose: (event?: EuiFlyoutCloseEvent) => void;
78+
onClose: (event: EuiFlyoutCloseEvent) => void;
7979
/**
8080
* Defines the width of the panel.
8181
* Pass a predefined size of `s | m | l`, or pass any number/string compatible with the CSS `width` attribute
@@ -218,8 +218,8 @@ export const EuiFlyoutComponent = forwardRef(
218218
<T extends ElementType = 'div' | 'nav'>(
219219
props: EuiFlyoutComponentProps<T>,
220220
ref:
221-
| ((instance: ComponentPropsWithRef<T> | null) => void)
222-
| MutableRefObject<ComponentPropsWithRef<T> | null>
221+
| ((instance: HTMLElement | null) => void)
222+
| MutableRefObject<HTMLElement | null>
223223
| null
224224
) => {
225225
const {
@@ -283,9 +283,7 @@ export const EuiFlyoutComponent = forwardRef(
283283
* Setting up the refs on the actual flyout element in order to
284284
* accommodate for the `isPushed` state by adding padding to the body equal to the width of the element
285285
*/
286-
const [resizeRef, setResizeRef] = useState<ComponentPropsWithRef<T> | null>(
287-
null
288-
);
286+
const [resizeRef, setResizeRef] = useState<HTMLElement | null>(null);
289287
const setRef = useCombinedRefs([
290288
setResizeRef,
291289
ref,

packages/eui/src/components/flyout/flyout_menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const EuiFlyoutMenu: FunctionComponent<EuiFlyoutMenuProps> = ({
187187
);
188188
}
189189

190-
const handleClose = (event: EuiFlyoutCloseEvent | undefined) => {
190+
const handleClose = (event: EuiFlyoutCloseEvent) => {
191191
onClose?.(event);
192192
};
193193

0 commit comments

Comments
 (0)