Allow column without accessor or id

This commit is contained in:
Tanner Linsley
2016-10-27 16:38:55 -06:00
parent e6d03673ff
commit e4208e3b0f
+5 -4
View File
@@ -126,14 +126,15 @@ export default React.createClass({
return dcol
}
if (!dcol.accessor) {
dcol.accessor = d => undefined
}
if (!dcol.id) {
if (dcol.accessor && !dcol.id) {
console.warn(dcol)
throw new Error('A column id is required if using a non-string accessor for column above.')
}
if (!dcol.accessor) {
dcol.accessor = d => undefined
}
return dcol
}