diff --git a/src/factory/createHTMLMediaHook.ts b/src/factory/createHTMLMediaHook.ts index 0f80575591..2bdae11085 100644 --- a/src/factory/createHTMLMediaHook.ts +++ b/src/factory/createHTMLMediaHook.ts @@ -29,12 +29,12 @@ export interface HTMLMediaControls { type MediaPropsWithRef = HTMLMediaProps & { ref?: React.MutableRefObject }; -export default function createHTMLMediaHook(tag: 'audio' | 'video') { - return ( - elOrProps: HTMLMediaProps | React.ReactElement -) => { - let element: React.ReactElement> | undefined; - let props: MediaPropsWithRef; +export default function createHTMLMediaHook( + tag: 'audio' | 'video' +) { + return (elOrProps: HTMLMediaProps | React.ReactElement) => { + let element: React.ReactElement> | undefined; + let props: MediaPropsWithRef; if (React.isValidElement(elOrProps)) { element = elOrProps; @@ -51,7 +51,7 @@ export default function createHTMLMediaHook(null); + const ref = useRef(null); const wrapEvent = (userEvent, proxyEvent?) => { return (event) => { @@ -229,6 +229,6 @@ export default function createHTMLMediaHook