mirror of
https://github.com/gosticks/react-table.git
synced 2025-10-16 11:55:36 +00:00
Allow row generator to listen for column changes (#1442)
* added column dependency to row generator memo listeners * added assertion to stop an infinite loop inside usePagination
This commit is contained in:
parent
16df48f950
commit
64e9d91e3c
@ -189,7 +189,7 @@ export const useTable = (props, ...plugins) => {
|
||||
|
||||
// Create the cells and values
|
||||
row.values = {}
|
||||
instanceRef.current.columns.forEach(column => {
|
||||
columns.forEach(column => {
|
||||
row.values[column.id] = column.accessor
|
||||
? column.accessor(originalRow, i, { subRows, depth, data })
|
||||
: undefined
|
||||
@ -203,7 +203,7 @@ export const useTable = (props, ...plugins) => {
|
||||
if (process.env.NODE_ENV === 'development' && debug)
|
||||
console.timeEnd('getAccessedRows')
|
||||
return [accessedData, rowPaths, flatRows]
|
||||
}, [debug, data, subRowsKey])
|
||||
}, [debug, data, columns, subRowsKey])
|
||||
|
||||
instanceRef.current.rows = rows
|
||||
instanceRef.current.rowPaths = rowPaths
|
||||
|
||||
Loading…
Reference in New Issue
Block a user