chatpad/src/hooks/useChatId.ts
Andrei Canta 6830e88843 launch
2023-03-17 21:58:39 +02:00

7 lines
207 B
TypeScript

import { useMatchRoute } from "@tanstack/react-location";
export function useChatId() {
const matchRoute = useMatchRoute();
const match = matchRoute({ to: "/chats/:chatId" });
return match?.chatId;
}