-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Remove apiRef
from options
params
#2312
[DataGrid] Remove apiRef
from options
params
#2312
Conversation
…HeaderOut, onColumnHeaderOver, onColumnHeaderDoubleClick, onColumnHeaderClick
…wDoubleClick, onRowOver, onRowOut, onRowEnter, onRowLeave
… onCellEditStop, onCellBlur, onCellClick, onCellDoubleClick, onCellFocusOut, onCellKeyDown, onCellOver, onCellOut, onCellEnter, onCellLeave
…taGrid-1821-remove-apiRef-from-options-params
apiRef
from options
params
packages/grid/_modules_/grid/hooks/features/rows/useGridEditRows.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems weird to me to remove api
from GridRowParams
but keep it in GridCellParams
. I would remove from both and for those places where it needs to be passed we add a child interface including it: e.g. ValueParserParams
.
I found GridCellOptionsParams
a bit confusing, because options and params are the same thing. Maybe by doing the first proposal we don't need it.
packages/grid/_modules_/grid/hooks/features/rows/useGridEditRows.ts
Outdated
Show resolved
Hide resolved
…ws.ts Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Ok, the problem with that aproach is that by keeping the I would keep it as it is but maybe change the name of the interface |
No, we would create dedicated interfaces for each of these callbacks. In the case of The reason I'm against keeping the |
But you would still need to pass in the |
The This component could use One of our technical debts is that we used |
@m4theushw @oliviertassinari I've updated the |
I have resolved the conflict that I introduced with #2340 (I work on this after seeing the same in this PR). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Fixes #1821
Fixes #1301
This is part 2 of 2 for #1821. As we discussed during the call the
api
is removed from alloptions
callbacks. It is only present in what callbacks are in theGridColDef
.Breaking changes
All
DataGrid
props
callbacks don't provide access toapi
anymore. To accessapi
you need to useXGrid
and access it from thedetails
parameter.GridStateChangeParams
is removed, insteadonStateChange
first param isGridState