Skip to content

Commit

Permalink
fixes DataTable rendering in doscover (opensearch-project#5207)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
  • Loading branch information
ashwin-pc authored and SuZhou-Joe committed Oct 7, 2023
1 parent 40dd4bd commit d771c26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ 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';
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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 (
<EuiPanel
hasBorder={false}
Expand Down Expand Up @@ -126,3 +123,6 @@ export default function DiscoverCanvas({ setHeaderActionMenu, history }: ViewPro
</EuiPanel>
);
}

const MemoizedDiscoverTable = React.memo(DiscoverTable);
const MemoizedDiscoverChartContainer = React.memo(DiscoverChartContainer);

0 comments on commit d771c26

Please sign in to comment.