import { render , unmountComponentAtNode } from 'react-dom' ; import React from 'react' ; import { EuiErrorBoundary } from '@elastic/eui' ; import type { AppMountParameters } from 'kibana/public' ; import type { ScreenshottingSetup } from '../../../screenshotting/public' ; import type { SharePluginSetup } from '../shared_imports' ; import type { ReportingAPIClient } from '../lib/reporting_api_client' ; import { RedirectApp } from './redirect_app' ; interface MountParams extends AppMountParameters { apiClient : ReportingAPIClient ; screenshotting : ScreenshottingSetup ; share : SharePluginSetup ; } export const mountRedirectApp = ( { element , apiClient , history , screenshotting , share , } ) => { render ( < EuiErrorBoundary > < RedirectApp apiClient = { apiClient } history = { history } screenshotting = { screenshotting } share = { share } / > < /EuiErrorBoundary>, element); return ( ) => { unmountComponentAtNode ( element ) ; } ; } ;