From f1e20cd0b54622d634202c85cca920323e4df336 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Thu, 16 Jun 2022 17:26:31 -0400 Subject: [PATCH] fix(Focusable): add ref prop, fix event types --- src/deck-components/Focusable.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/deck-components/Focusable.tsx b/src/deck-components/Focusable.tsx index 371ce65..8e2f2aa 100644 --- a/src/deck-components/Focusable.tsx +++ b/src/deck-components/Focusable.tsx @@ -1,4 +1,4 @@ -import { HTMLAttributes, ReactNode, VFC } from "react"; +import { HTMLAttributes, ReactNode, RefAttributes, VFC } from "react"; import { findModuleChild } from "../webpack"; export interface FocusableProps extends HTMLAttributes { @@ -6,8 +6,8 @@ export interface FocusableProps extends HTMLAttributes { "flow-children"?: string; focusClassName?: string; focusWithinClassName?: string; - onActivate?: () => void; - onCancel?: () => void; + onActivate?: (e: CustomEvent) => void; + onCancel?: (e: CustomEvent) => void; } export const Focusable = findModuleChild((m) => { @@ -16,4 +16,4 @@ export const Focusable = findModuleChild((m) => { if (m[prop]?.render?.toString()?.includes('["flow-children","onActivate","onCancel","focusClassName",')) return m[prop]; } -}) as VFC; \ No newline at end of file +}) as VFC>; \ No newline at end of file