kibana/x-pack/plugins/searchprofiler/public/application/index.tsx
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00

45 lines
1.2 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { HttpStart as Http, ToastsSetup } from 'kibana/public';
import { LicenseStatus } from '../../common';
import { App } from './app';
import { AppContextProvider } from './contexts/app_context';
import { ProfileContextProvider } from './contexts/profiler_context';
interface AppDependencies {
el: HTMLElement;
http: Http;
I18nContext: any;
notifications: ToastsSetup;
initialLicenseStatus: LicenseStatus;
}
export const renderApp = ({
el,
http,
I18nContext,
notifications,
initialLicenseStatus,
}: AppDependencies) => {
render(
<I18nContext>
<AppContextProvider args={{ initialLicenseStatus, notifications, http }}>
<ProfileContextProvider>
<App />
</ProfileContextProvider>
</AppContextProvider>
</I18nContext>,
el
);
return () => unmountComponentAtNode(el);
};