diff --git a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.onappleave.md b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.onappleave.md index 7f72d6a52fc2a..e898126a553e2 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appmountparameters.onappleave.md +++ b/docs/development/core/public/kibana-plugin-core-public.appmountparameters.onappleave.md @@ -23,10 +23,10 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter, Route } from 'react-router-dom'; -import { CoreStart, AppMountParams } from 'src/core/public'; +import { CoreStart, AppMountParameters } from 'src/core/public'; import { MyPluginDepsStart } from './plugin'; -export renderApp = ({ element, history, onAppLeave }: AppMountParams) => { +export renderApp = ({ element, history, onAppLeave }: AppMountParameters) => { const { renderApp, hasUnsavedChanges } = await import('./application'); onAppLeave(actions => { if(hasUnsavedChanges()) { diff --git a/src/core/CONVENTIONS.md b/src/core/CONVENTIONS.md index 447c6f396945f..798977354f277 100644 --- a/src/core/CONVENTIONS.md +++ b/src/core/CONVENTIONS.md @@ -167,17 +167,21 @@ leverage this pattern. import React from 'react'; import ReactDOM from 'react-dom'; -import { CoreStart, AppMountParams } from '../../src/core/public'; +import { CoreStart, AppMountParameters } from 'src/core/public'; import { MyAppRoot } from './components/app.ts'; /** * This module will be loaded asynchronously to reduce the bundle size of your plugin's main bundle. */ -export const renderApp = (core: CoreStart, deps: MyPluginDepsStart, { element, history }: AppMountParams) => { +export const renderApp = ( + core: CoreStart, + deps: MyPluginDepsStart, + { element, history }: AppMountParameters +) => { ReactDOM.render(, element); return () => ReactDOM.unmountComponentAtNode(element); -} +}; ``` ```ts diff --git a/src/core/TESTING.md b/src/core/TESTING.md index cb38dac0e20ce..bed41ab583496 100644 --- a/src/core/TESTING.md +++ b/src/core/TESTING.md @@ -475,10 +475,14 @@ The more interesting logic is in `renderApp`: import React from 'react'; import ReactDOM from 'react-dom'; -import { AppMountParams, CoreStart } from 'src/core/public'; +import { AppMountParameters, CoreStart } from 'src/core/public'; import { AppRoot } from './components/app_root'; -export const renderApp = ({ element, history }: AppMountParams, core: CoreStart, plugins: MyPluginDepsStart) => { +export const renderApp = ( + { element, history }: AppMountParameters, + core: CoreStart, + plugins: MyPluginDepsStart +) => { // Hide the chrome while this app is mounted for a full screen experience core.chrome.setIsVisible(false); diff --git a/src/core/public/application/scoped_history.ts b/src/core/public/application/scoped_history.ts index 1a7fafa5d85c4..4392cf4eca8d4 100644 --- a/src/core/public/application/scoped_history.ts +++ b/src/core/public/application/scoped_history.ts @@ -197,7 +197,7 @@ export class ScopedHistory prompt?: boolean | string | TransitionPromptHook ): UnregisterCallback => { throw new Error( - `history.block is not supported. Please use the AppMountParams.onAppLeave API.` + `history.block is not supported. Please use the AppMountParameters.onAppLeave API.` ); }; diff --git a/src/core/public/application/types.ts b/src/core/public/application/types.ts index 2269fd0a4ca48..8006ec846138f 100644 --- a/src/core/public/application/types.ts +++ b/src/core/public/application/types.ts @@ -453,10 +453,10 @@ export interface AppMountParameters { * import ReactDOM from 'react-dom'; * import { BrowserRouter, Route } from 'react-router-dom'; * - * import { CoreStart, AppMountParams } from 'src/core/public'; + * import { CoreStart, AppMountParameters } from 'src/core/public'; * import { MyPluginDepsStart } from './plugin'; * - * export renderApp = ({ element, history, onAppLeave }: AppMountParams) => { + * export renderApp = ({ element, history, onAppLeave }: AppMountParameters) => { * const { renderApp, hasUnsavedChanges } = await import('./application'); * onAppLeave(actions => { * if(hasUnsavedChanges()) {