Skip to content

Commit

Permalink
re-fix useMemo
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Oct 16, 2023
1 parent 1f8e327 commit e8ebb2d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import React, { FC, useContext } from 'react';
import React, { FC, useContext, useMemo } from 'react';

import { ErrorBoundaryServices } from '../../types';
import { ErrorService } from './error_service';
Expand All @@ -29,10 +29,11 @@ export const ErrorBoundaryProvider: FC<ErrorBoundaryServices> = ({
*/
export const ErrorBoundaryKibanaProvider: FC = ({ children }) => {
const reloadWindow = () => window.location.reload();
const errorService = useMemo(() => new ErrorService(), []);

const value: ErrorBoundaryServices = {
reloadWindow,
errorService: new ErrorService(),
errorService,
};

return <Context.Provider value={value}>{children}</Context.Provider>;
Expand Down

0 comments on commit e8ebb2d

Please sign in to comment.