Skip to content

Commit

Permalink
[@mantine/hooks] use-click-outside: Fix incorrect typescript definiti…
Browse files Browse the repository at this point in the history
…on for strict mode (#3119)
  • Loading branch information
rtivital committed Dec 12, 2022
1 parent feeea02 commit c485f9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/src/docs/hooks/use-click-outside.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ import { useClickOutside } from '@mantine/hooks';
import { Portal } from '@mantine/core';

function Demo() {
const [dropdown, setDropdown] = useState(null);
const [control, setControl] = useState(null);
const [dropdown, setDropdown] = useState<HTMLDivElement | null>(null);
const [control, setControl] = useState<HTMLDivElement | null>(null);

useClickOutside(() => console.log('outside'), null, [control, dropdown]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const DEFAULT_EVENTS = ['mousedown', 'touchstart'];
export function useClickOutside<T extends HTMLElement = any>(
handler: () => void,
events?: string[] | null,
nodes?: HTMLElement[]
nodes?: (HTMLElement | null)[]
) {
const ref = useRef<T>();

Expand Down

0 comments on commit c485f9a

Please sign in to comment.