diff --git a/src/plugins/discover/public/application/view_components/canvas/discover_table.tsx b/src/plugins/discover/public/application/view_components/canvas/discover_table.tsx index a7db2ce3034f..4e3f6bf04b24 100644 --- a/src/plugins/discover/public/application/view_components/canvas/discover_table.tsx +++ b/src/plugins/discover/public/application/view_components/canvas/discover_table.tsx @@ -16,7 +16,6 @@ import { useDispatch, useSelector, } from '../../utils/state_management'; -import { useSearch } from '../utils/use_search'; import { IndexPatternField, opensearchFilters } from '../../../../../data/public'; import { DocViewFilterFn } from '../../doc_views/doc_views_types'; import { SortOrder } from '../../../saved_searches/types'; @@ -24,7 +23,7 @@ import { DOC_HIDE_TIME_COLUMN_SETTING } from '../../../../common'; import { OpenSearchSearchHit } from '../../doc_views/doc_views_types'; interface Props { - rows: OpenSearchSearchHit[]; + rows?: OpenSearchSearchHit[]; } export const DiscoverTable = ({ rows }: Props) => { diff --git a/src/plugins/discover/public/application/view_components/canvas/index.tsx b/src/plugins/discover/public/application/view_components/canvas/index.tsx index 1d994c92a2ea..fabe2373bfea 100644 --- a/src/plugins/discover/public/application/view_components/canvas/index.tsx +++ b/src/plugins/discover/public/application/view_components/canvas/index.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import React, { useEffect, useState, useRef, useCallback, useMemo } from 'react'; +import React, { useEffect, useState, useRef, useCallback } from 'react'; import { EuiPanel } from '@elastic/eui'; import { TopNav } from './top_nav'; import { ViewProps } from '../../../../../data_explorer/public'; @@ -89,9 +89,6 @@ export default function DiscoverCanvas({ setHeaderActionMenu, history }: ViewPro const timeField = indexPattern?.timeFieldName ? indexPattern.timeFieldName : undefined; - const MemoizedDiscoverTable = React.memo(DiscoverTable); - const MemoizedDiscoverChartContainer = React.memo(DiscoverChartContainer); - return ( ); } + +const MemoizedDiscoverTable = React.memo(DiscoverTable); +const MemoizedDiscoverChartContainer = React.memo(DiscoverChartContainer);