import React from 'react' ; import ReactDOM from 'react-dom' ; import { Router , Route , Switch } from 'react-router-dom' ; import { AppMountParameters , CoreStart } from '../../../../src/core/public' ; import { KibanaThemeProvider } from '../../../../../kibana/src/plugins/kibana_react/public' ; import { CaptureTest } from './containers/capture_test' ; import { Main } from './containers/main' ; import { ApplicationContextProvider } from './application_context' ; import { SetupDeps , StartDeps , MyForwardableState } from './types' ; import { ROUTES } from './constants' ; export const renderApp = ( coreStart , deps , { appBasePath , element , history } , forwardedParams ) => { ReactDOM . render ( < ApplicationContextProvider forwardedState = { forwardedParams } > < KibanaThemeProvider theme$ = { coreStart . theme . theme$ } > < Router history = { history } > < Switch > < Route path = { ROUTES . captureTest } exact render = { ( ) => < CaptureTest />}/ > < Route render = { ( ) => < Main basename = { appBasePath } { ... coreStart } { ... deps } />}/ > < /Switch> < /Router> < /KibanaThemeProvider> < /ApplicationContextProvider>, element); return ( ) => ReactDOM . unmountComponentAtNode ( element ) ; } ;