[RFC] Improve grid column definition typing #7188
Labels
breaking change
component: data grid
This is the name of the generic UI component, not the React module!
dx
Related to developers' experience
RFC
Request For Comments
typescript
What's the problem? 🤔
I usually use the
GridColDef
interface when defining grid columns:But I've noticed that it doesn't work with the
actions
column type. In this case, different interfaces should be used instead:We use both
GridColDef
andGridColumns
in our demos, so it's not clear which one should be used and what is the difference between them.This is confusing - see #7115 (comment) for example.
What are the requirements? ❓
Ideally, we should expose a single interface that would work for every column type.
What are our options? 💡
Currently, the
GridEnrichedColDef
should work for every column type, but the interface name is not straightforward and we don't use it in our demos - so it's almost impossible to discover.Proposed solution 🟢
GridEnrichedColDef
toGridColDef
GridColDef
toGridBaseColDef
GridColumns
interface and useGridColDef[]
insteadResources and benchmarks 🔗
No response
The text was updated successfully, but these errors were encountered: