TanStack Table itself is written in TypeScript, and Mantine React Table builds on top of its great type definitions for best in class TypeScript experience.
If, however, you cannot use TypeScript in your project for some reason, checkout down below for how to use JSDoc instead of TypeScript to get the same type hints.
Is TypeScript Required?
Define You TData Type
Mantine React Table makes use of generics to make working with your specific row data structures easier. You will see that most of the
MRT_*types that you can use accept a
Let's say that the data in your table is an array of users that looks like this:
TDatatype can be defined as:
Define Your Column Definitions with MRT_ColumnDef
Mantine React Table provides you with a
MRT_ColumnDeftype that you can use to define your column definitions. It is a generic type that accepts your
TDatatype as a generic.
Use JSDoc instead of TypeScript