File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -29,12 +29,12 @@ export interface HTMLMediaControls {
2929
3030type MediaPropsWithRef < T > = HTMLMediaProps & { ref ?: React . MutableRefObject < T | null > } ;
3131
32- export default function createHTMLMediaHook < T extends HTMLAudioElement | HTMLVideoElement > ( tag : 'audio' | 'video' ) {
33- return (
34- elOrProps : HTMLMediaProps | React . ReactElement < HTMLMediaProps >
35- ) => {
36- let element : React . ReactElement < MediaPropsWithRef < T > > | undefined ;
37- let props : MediaPropsWithRef < T > ;
32+ export default function createHTMLMediaHook < T extends HTMLAudioElement | HTMLVideoElement > (
33+ tag : 'audio' | 'video'
34+ ) {
35+ return ( elOrProps : HTMLMediaProps | React . ReactElement < HTMLMediaProps > ) => {
36+ let element : React . ReactElement < MediaPropsWithRef < T > > | undefined ;
37+ let props : MediaPropsWithRef < T > ;
3838
3939 if ( React . isValidElement ( elOrProps ) ) {
4040 element = elOrProps ;
@@ -51,7 +51,7 @@ export default function createHTMLMediaHook<T extends HTMLAudioElement | HTMLVid
5151 muted : false ,
5252 volume : 1 ,
5353 } ) ;
54- const ref = useRef < T | null > ( null ) ;
54+ const ref = useRef < T | null > ( null ) ;
5555
5656 const wrapEvent = ( userEvent , proxyEvent ?) => {
5757 return ( event ) => {
@@ -229,6 +229,6 @@ export default function createHTMLMediaHook<T extends HTMLAudioElement | HTMLVid
229229 }
230230 } , [ props . src ] ) ;
231231
232- return [ element , state , controls , ref ] as const ;
233- }
234- } ;
232+ return [ element , state , controls , ref ] as const ;
233+ } ;
234+ }
You can’t perform that action at this time.
0 commit comments