From 24092f646fbb1242eaa7dfc467a080b9aef5709a Mon Sep 17 00:00:00 2001 From: Bryan Deloeste Date: Thu, 11 Apr 2019 15:38:35 -0700 Subject: [PATCH] fix ref return type in tuple --- types/react-click-outside-hook/index.d.ts | 5 +++-- .../react-click-outside-hook-tests.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/types/react-click-outside-hook/index.d.ts b/types/react-click-outside-hook/index.d.ts index 2e78125467..6bbbe7aa42 100644 --- a/types/react-click-outside-hook/index.d.ts +++ b/types/react-click-outside-hook/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Bryan Deloeste // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import { MutableRefObject } from "react"; -export function useClickOutside(): [MutableRefObject, boolean]; +type HookReturnTuple = [((node?: Element | null) => void), boolean]; + +export function useClickOutside(): HookReturnTuple; diff --git a/types/react-click-outside-hook/react-click-outside-hook-tests.tsx b/types/react-click-outside-hook/react-click-outside-hook-tests.tsx index b5ce2ad7a6..e6730ce7fe 100644 --- a/types/react-click-outside-hook/react-click-outside-hook-tests.tsx +++ b/types/react-click-outside-hook/react-click-outside-hook-tests.tsx @@ -4,7 +4,7 @@ import { render } from "react-dom"; import { useClickOutside } from "react-click-outside-hook"; function Component() { - const [ref, hasClickedOutside] = useClickOutside(); + const [ref, hasClickedOutside] = useClickOutside(); return
{hasClickedOutside.toString()}
; }