import React from 'react' ; import { render , unmountComponentAtNode } from 'react-dom' ; import { Router } from 'react-router-dom' ; import { ScopedHistory } from 'kibana/public' ; import { App } from './app' ; import { AppProviders } from './app_providers' ; import { AppDependencies } from './app_context' ; interface AppWithRouterProps { history : ScopedHistory ; } const AppWithRouter = ( { history } ) => ( < Router history = { history } > < App /> < /Router>); export const renderApp = ( elem , dependencies ) => { render ( < AppProviders appDependencies = { dependencies } > < AppWithRouter history = { dependencies . services . history } / > < /AppProviders>, elem); return ( ) => { unmountComponentAtNode ( elem ) ; } ; } ; export type { AppDependencies } ;