[data grid] consider providing defaults for rows and columns prop #13111
Labels
component: data grid
This is the name of the generic UI component, not the React module!
enhancement
This is not a bug, nor a new feature
feature: Rendering layout
Related to the data grid Rendering engine
Summary
I'm very aware that this is a minor usability issue, but it's been bugging me for a long time 馃槃
Currently, when adding a grid to my app without specifying any properties, an error is thrown:
One always has to specify
rows
andcolumns
properties. I propose to make these properties optional and have them default to an empty array. The grid would then just display an empty grid with no columns.I understand that a grid without these properties is not very meaningful for a production app, but I think there is a good reason to add them anyway. When I'm adding a grid in the page during development, almost always is my first concern to take care about sizing and fitting it in the page layout. Only once I've established that and verified in my browser the grid is where I want, I start working on the data loading. So I always find myself writing
<DataGrid rows={[]} columns={[]} />
anyway. IMO you may as well just make them empty arrays by default.Examples
No response
Motivation
No response
Search keywords: rows columns default
The text was updated successfully, but these errors were encountered: