rowIdx is passed to renderCell but not to renderEditCell. This PR fixes that unless there's any reason otherwise.
In my use case, I'm rendering a custom input component that updates a react-hook-form context, and it references the form field using the dot notation e.g. persons.1.height etc.
The status quo with rdg only exposing row, I have to expand my rows objects to contain their own indexes, or do a rows.findIndex, which forces me to declare columns inside the render cycle and deal with memoization etc. Neither are ideal, especially because the solution is right under our noses.
The proposed PR makes it trivially simple to achieve that:
rowIdx
is passed torenderCell
but not torenderEditCell
. This PR fixes that unless there's any reason otherwise.In my use case, I'm rendering a custom
input
component that updates a react-hook-form context, and it references the form field using the dot notation e.g.persons.1.height
etc.The status quo with rdg only exposing
row
, I have to expand my rows objects to contain their own indexes, or do arows.findIndex
, which forces me to declarecolumns
inside the render cycle and deal with memoization etc. Neither are ideal, especially because the solution is right under our noses.The proposed PR makes it trivially simple to achieve that: