diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index 14e1a6f..6bf7a86 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -21,9 +21,9 @@ export default function ChatFragment({ target, ...props }: Args) { } as Chat) const [tabItemSelected, setTabItemSelected] = React.useState('Chat') - const tabRef: React.MutableRefObject = React.useRef(null) - useEventListener(tabRef, 'change', (event) => { - setTabItemSelected((event.target as HTMLElement as Tab).value as string) + const tabRef = React.useRef(null) + useEventListener(tabRef, 'change', () => { + setTabItemSelected(tabRef.current?.value || "Chat") }) React.useEffect(() => { @@ -38,6 +38,7 @@ export default function ChatFragment({ target, ...props }: Args) { })() }, [target]) + console.log(tabItemSelected) return (