Skip to content

Commit

Permalink
memo AppWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jcger committed Sep 18, 2024
1 parent 57d7377 commit 928bb4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x-pack/plugins/cases/public/common/mock/test_providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/* eslint-disable no-console */

import type { PropsWithChildren } from 'react';
import React, { useMemo } from 'react';
import { MemoryRouter } from 'react-router-dom';
import { act, render as reactRender, waitFor } from '@testing-library/react';
Expand Down Expand Up @@ -156,7 +157,7 @@ export const createAppMockRenderer = ({

const getFilesClient = mockGetFilesClient();

const AppWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
const AppWrapper = React.memo<PropsWithChildren<unknown>>(({ children }) => (
<KibanaRenderContextProvider i18n={coreStart.i18n} theme={coreStart.theme}>
<KibanaContextProvider services={services}>
<MemoryRouter>
Expand All @@ -177,7 +178,7 @@ export const createAppMockRenderer = ({
</MemoryRouter>
</KibanaContextProvider>
</KibanaRenderContextProvider>
);
));

AppWrapper.displayName = 'AppWrapper';

Expand Down

0 comments on commit 928bb4c

Please sign in to comment.