Skip to content

Commit

Permalink
PR review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jportner committed Feb 9, 2021
1 parent f177ade commit 9d1e02e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const mountManagementSection = async ({
return children! as React.ReactElement;
};

const spacesApi = (spacesOss?.isSpacesAvailable && spacesOss) || undefined;
const spacesApi = spacesOss?.isSpacesAvailable ? spacesOss : undefined;

ReactDOM.render(
<I18nProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import React, { createElement, useEffect, useMemo } from 'react';
import React, { useEffect, useMemo } from 'react';
import { useLocation } from 'react-router-dom';
import { get } from 'lodash';
import { Query } from '@elastic/eui';
Expand All @@ -23,8 +23,7 @@ import {
} from '../services';
import { SavedObjectsTable } from './objects_table';

const EmptyFunctionComponent: React.FC = ({ children }) =>
createElement('EmptyFunctionComponent', { children });
const EmptyFunctionComponent: React.FC = ({ children }) => <>{children}</>;

const SavedObjectsTablePage = ({
coreStart,
Expand Down Expand Up @@ -71,7 +70,10 @@ const SavedObjectsTablePage = ({
]);
}, [setBreadcrumbs]);

const ContextWrapper = spacesApi?.ui.components.SpacesContext || EmptyFunctionComponent;
const ContextWrapper = useMemo(
() => spacesApi?.ui.components.SpacesContext || EmptyFunctionComponent,
[spacesApi]
);

return (
<ContextWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import PropTypes from 'prop-types';
import React, { createElement, Component } from 'react';
import React, { Component } from 'react';

import { sortBy } from 'lodash';
import moment from 'moment';
Expand All @@ -26,8 +26,7 @@ import { AnomalyDetectionJobIdLink } from './job_id_link';

const PAGE_SIZE_OPTIONS = [10, 25, 50];

const EmptyFunctionComponent = ({ children }) =>
createElement('EmptyFunctionComponent', { children });
const EmptyFunctionComponent = ({ children }) => <>{children}</>;

// 'isManagementTable' bool prop to determine when to configure table for use in Kibana management page
export class JobsList extends Component {
Expand Down

0 comments on commit 9d1e02e

Please sign in to comment.