Something went wrong. Try again.
a tool for shared writing and social publishing
Something went wrong. Try again.
363 B · 16 lines
TSX
at perf/paste
1234567891011121314151617import { createContext, useContext } from "react";import type { CommentInfo } from "./usePageComments";
type CommentContextValue = { pageID: string; comments: CommentInfo[];};
export const CommentContext = createContext<CommentContextValue>({ pageID: "", comments: [],});
export function useCommentContext() { return useContext(CommentContext);}