Examples › Non-standard record IDs
By default, the DataTable assumes that each record has an id property holding a unique value of a primitive type (such as a string or a number).
Record IDs are used internally as React keys when rendering rows, and to identify records in features such as records selection and row expansion (for instance, the rowExpansion.expanded.recordIds array holds the IDs of the expanded records).
If your records use a different unique property, set the idAccessor property of the DataTable to its name, like so:
The code above will produce the following result:
Using functions to generate composite record IDs
You can also pass a function that receives a record and returns its ID. This is useful when no single property is unique and you need to build a composite ID from several record properties:
The code above will produce the following result:
Head over to the next example to discover more features.












