Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
2d19c046
Unverified
Commit
2d19c046
authored
May 13, 2020
by
Hugo Häggmark
Committed by
GitHub
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Table: fixes Cannot read property subRows of null (#24578)
parent
5feef220
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
packages/grafana-ui/src/components/Table/Table.tsx
+6
-11
No files found.
packages/grafana-ui/src/components/Table/Table.tsx
View file @
2d19c046
import
React
,
{
FC
,
memo
,
use
Memo
,
useCallback
}
from
'react'
;
import
React
,
{
FC
,
memo
,
use
Callback
,
useMemo
}
from
'react'
;
import
{
DataFrame
,
Field
}
from
'@grafana/data'
;
import
{
Cell
,
...
...
@@ -6,10 +6,10 @@ import {
HeaderGroup
,
useAbsoluteLayout
,
useResizeColumns
,
useSortBy
,
useTable
,
UseResizeColumnsState
,
useSortBy
,
UseSortByState
,
useTable
,
}
from
'react-table'
;
import
{
FixedSizeList
}
from
'react-window'
;
import
{
getColumns
,
getTextAlign
}
from
'./utils'
;
...
...
@@ -73,14 +73,9 @@ export const Table: FC<Props> = memo((props: Props) => {
if
(
!
data
.
fields
.
length
)
{
return
[];
}
// Check if an array buffer already exists
const
buffer
=
(
data
.
fields
[
0
].
values
as
any
).
buffer
;
if
(
Array
.
isArray
(
buffer
)
&&
buffer
.
length
===
data
.
length
)
{
return
buffer
;
}
// For arrow tables, the `toArray` implementation is expensive and akward *especially* for timestamps
// as we only use this to fake the length of our data set for react-table we need to make sure we always return an array
// filled with values at each index otherwise we'll end up trying to call accessRow for null|undefined value in
// https://github.com/tannerlinsley/react-table/blob/7be2fc9d8b5e223fc998af88865ae86a88792fdb/src/hooks/useTable.js#L585
return
Array
(
data
.
length
).
fill
(
0
);
},
[
data
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment