mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
fix ref return type in tuple
This commit is contained in:
parent
01b4d030bd
commit
24092f646f
5
types/react-click-outside-hook/index.d.ts
vendored
5
types/react-click-outside-hook/index.d.ts
vendored
@ -3,6 +3,7 @@
|
||||
// Definitions by: Bryan Deloeste <https://github.com/bdeloeste>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
import { MutableRefObject } from "react";
|
||||
|
||||
export function useClickOutside<T>(): [MutableRefObject<T>, boolean];
|
||||
type HookReturnTuple = [((node?: Element | null) => void), boolean];
|
||||
|
||||
export function useClickOutside(): HookReturnTuple;
|
||||
|
||||
@ -4,7 +4,7 @@ import { render } from "react-dom";
|
||||
import { useClickOutside } from "react-click-outside-hook";
|
||||
|
||||
function Component() {
|
||||
const [ref, hasClickedOutside] = useClickOutside<HTMLDivElement>();
|
||||
const [ref, hasClickedOutside] = useClickOutside();
|
||||
return <div ref={ref}>{hasClickedOutside.toString()}</div>;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user