mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Feature Flags Example Plugin] Change ctx provider (#201097)
This commit is contained in:
parent
65cb53c28b
commit
f0262080c8
3 changed files with 10 additions and 15 deletions
|
@ -10,22 +10,19 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { AppMountParameters, CoreStart } from '@kbn/core/public';
|
||||
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
|
||||
import { KibanaRootContextProvider } from '@kbn/react-kibana-context-root';
|
||||
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
|
||||
import { FeatureFlagsExampleApp } from './components/app';
|
||||
|
||||
export const renderApp = (coreStart: CoreStart, { element }: AppMountParameters) => {
|
||||
const { notifications, http, featureFlags } = coreStart;
|
||||
ReactDOM.render(
|
||||
<KibanaRootContextProvider {...coreStart}>
|
||||
<KibanaPageTemplate>
|
||||
<FeatureFlagsExampleApp
|
||||
featureFlags={featureFlags}
|
||||
notifications={notifications}
|
||||
http={http}
|
||||
/>
|
||||
</KibanaPageTemplate>
|
||||
</KibanaRootContextProvider>,
|
||||
<KibanaRenderContextProvider {...coreStart}>
|
||||
<FeatureFlagsExampleApp
|
||||
featureFlags={featureFlags}
|
||||
notifications={notifications}
|
||||
http={http}
|
||||
/>
|
||||
</KibanaRenderContextProvider>,
|
||||
element
|
||||
);
|
||||
|
||||
|
|
|
@ -59,8 +59,7 @@ export const FeatureFlagsExampleApp = ({ featureFlags }: FeatureFlagsExampleAppD
|
|||
<h3>Rendered together</h3>
|
||||
<p>
|
||||
`useObservable` causes a full re-render of the component, updating the{' '}
|
||||
<i>statically</i>
|
||||
evaluated flags as well.
|
||||
<i>statically</i> evaluated flags as well.
|
||||
</p>
|
||||
<FeatureFlagsFullList featureFlags={featureFlags} />
|
||||
</EuiText>
|
||||
|
|
|
@ -14,12 +14,11 @@
|
|||
"exclude": ["target/**/*"],
|
||||
"kbn_references": [
|
||||
"@kbn/core",
|
||||
"@kbn/shared-ux-page-kibana-template",
|
||||
"@kbn/react-kibana-context-root",
|
||||
"@kbn/core-feature-flags-server",
|
||||
"@kbn/core-plugins-server",
|
||||
"@kbn/config-schema",
|
||||
"@kbn/developer-examples-plugin",
|
||||
"@kbn/core-feature-flags-browser",
|
||||
"@kbn/react-kibana-context-render",
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue