kibana/packages/kbn-plugin-generator/template/public/application.tsx.ejs
Spencer 7b23e7cd8b
[kbn/plugin-generator] remove sao, modernize (#75465)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-08-20 18:50:36 -07:00

25 lines
693 B
Plaintext

import React from 'react';
import ReactDOM from 'react-dom';
import { AppMountParameters, CoreStart } from '<%= importFromRoot('src/core/public') %>';
import { AppPluginStartDependencies } from './types';
import { <%= upperCamelCase(name) %>App } from './components/app';
export const renderApp = (
{ notifications, http }: CoreStart,
{ navigation }: AppPluginStartDependencies,
{ appBasePath, element }: AppMountParameters
) => {
ReactDOM.render(
<<%= upperCamelCase(name) %>App
basename={appBasePath}
notifications={notifications}
http={http}
navigation={navigation}
/>,
element
);
return () => ReactDOM.unmountComponentAtNode(element);
};