mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-12 04:50:20 +00:00
Fix utils.groupBy where watch key would cause error in Firefox
This commit is contained in:
+1
-1
@@ -135,7 +135,7 @@ function prefixAll (obj) {
|
||||
function groupBy (xs, key) {
|
||||
return xs.reduce((rv, x, i) => {
|
||||
const resKey = typeof key === 'function' ? key(x, i) : x[key]
|
||||
rv[resKey] = rv[resKey] || []
|
||||
rv[resKey] = isArray(rv[resKey]) ? rv[resKey] : []
|
||||
rv[resKey].push(x)
|
||||
return rv
|
||||
}, {})
|
||||
|
||||
Reference in New Issue
Block a user