Compare commits

...
2 Commits
Author SHA1 Message Date
Tanner Linsley 48e6d16d58 2.2.7 2016-10-27 16:39:04 -06:00
Tanner Linsley e4208e3b0f Allow column without accessor or id 2016-10-27 16:38:55 -06:00
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "2.2.6",
"version": "2.2.7",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/tannerlinsley/react-table#readme",
+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
}