#Typescript doc
1 messages · Page 1 of 1 (latest)
Hi @woven mango. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To type a document for a table in TypeScript (including React Native), you should use the generated Doc<"tableName"> type from your Convex project's convex/_generated/dataModel. This type is automatically created based on your schema and provides end-to-end type safety for your documents.
Here's how you can use it:
import { Doc } from "../convex/_generated/dataModel";
function MyComponent(props: { message: Doc<"messages"> }) {
// Now `props.message` is fully typed according to your schema
// ...
}