File size: 332 Bytes
b59aa07
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { useParams } from "react-router";

export function useConversationId() {
  const { conversationId } = useParams<{ conversationId: string }>();

  if (!conversationId) {
    throw new Error(
      "useConversationId must be used within a route that has a conversationId parameter",
    );
  }

  return { conversationId };
}