diff --git a/src/use-focus.ts b/src/use-focus.ts index b9c402d..291399a 100644 --- a/src/use-focus.ts +++ b/src/use-focus.ts @@ -9,7 +9,7 @@ interface FocusState { } export interface UseFocusOpts { disabled?: boolean; - onFocus: (focused: boolean) => void; + onFocus?: (focused: boolean) => void; } export const useFocus = ({ disabled, onFocus }: UseFocusOpts) => { const [focusState, setState] = useState(), diff --git a/src/use-position.ts b/src/use-position.ts index 881d51a..b47d2e0 100644 --- a/src/use-position.ts +++ b/src/use-position.ts @@ -47,7 +47,7 @@ export const position = ({ }; interface UsePositionOpts extends Omit { - anchor?: (() => HTMLElement) | HTMLElement | null; + anchor?: (() => HTMLElement | null) | HTMLElement | null; } export const usePosition = ({ anchor: anchorage,