[release-12.1.3] Table: Avoid thrown error due to internal React issue (#111945)

Table: Fix hooks issue ordering issue
This commit is contained in:
Paul Marbach 2025-10-07 11:22:37 -04:00 committed by GitHub
parent 673e0684ff
commit 70fcd166fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 5 deletions

View File

@ -34,6 +34,10 @@ export function TablePanel(props: Props) {
const theme = useTheme2();
const panelContext = usePanelContext();
const _getActions = useCallback(
(frame: DataFrame, field: Field, rowIndex: number) => getCellActions(frame, field, rowIndex, replaceVariables),
[replaceVariables]
);
const frames = hasDeprecatedParentRowIndex(data.series)
? migrateFromParentRowIndexToNestedFrames(data.series)
: data.series;
@ -57,11 +61,6 @@ export function TablePanel(props: Props) {
const enableSharedCrosshair = panelContext.sync && panelContext.sync() !== DashboardCursorSync.Off;
const _getActions = useCallback(
(frame: DataFrame, field: Field, rowIndex: number) => getCellActions(frame, field, rowIndex, replaceVariables),
[replaceVariables]
);
const tableElement = (
<TableNG
height={tableHeight}