fix: datatable crash when column is empty string (#17303)

* fix: datatable crash when column is empty string

* typo
This commit is contained in:
Yongjie Zhao
2021-11-01 15:58:31 +00:00
committed by GitHub
parent abf24bbb5d
commit 1f2a7a40c4

View File

@@ -135,7 +135,8 @@ export const useTableColumns = (
key => key =>
({ ({
accessor: row => row[key], accessor: row => row[key],
Header: key, // When the key is empty, have to give a string of length greater than 0
Header: key || ' ',
Cell: ({ value }) => { Cell: ({ value }) => {
if (value === true) { if (value === true) {
return BOOL_TRUE_DISPLAY; return BOOL_TRUE_DISPLAY;