mirror of
https://github.com/gosticks/react-table.git
synced 2026-06-29 01:20:02 +00:00
Fixed Column Accessor bug
This commit is contained in:
19
example/dist/app.js
vendored
19
example/dist/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -21,7 +21,8 @@ export default Component({
|
||||
accessor: 'firstName'
|
||||
}, {
|
||||
header: 'Last Name',
|
||||
accessor: 'lastName'
|
||||
id: 'lastName',
|
||||
accessor: d => d.lastName
|
||||
}]
|
||||
}, {
|
||||
header: 'Info',
|
||||
|
||||
@@ -126,12 +126,14 @@ export default React.createClass({
|
||||
return dcol
|
||||
}
|
||||
|
||||
if (dcol.accessor && !dcol.id) {
|
||||
if (!dcol.accessor) {
|
||||
dcol.accessor = d => undefined
|
||||
}
|
||||
if (!dcol.id) {
|
||||
console.warn(dcol)
|
||||
throw new Error('A column id is required if using a non-string accessor for column above.')
|
||||
}
|
||||
|
||||
dcol.accessor = d => undefined
|
||||
return dcol
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user