Skip to content

Commit

Permalink
#354: fixed typescript reference
Browse files Browse the repository at this point in the history
  • Loading branch information
basmasking committed Dec 6, 2024
1 parent 9e1f74a commit f50c21c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/webui/hooks/useFocusOnMount.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

import { RefObject, useEffect } from 'react';

export function useFocusOnMount(elementRef: RefObject<HTMLElement>)
export function useFocusOnMount(elementRef: RefObject<HTMLElement | null>)
{
useEffect(() =>
{
if (elementRef === null) return;

elementRef.current?.focus();

}, [elementRef]);
Expand Down

0 comments on commit f50c21c

Please sign in to comment.