mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -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 React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { AppMountParameters, CoreStart } from '@kbn/core/public';
|
import { AppMountParameters, CoreStart } from '@kbn/core/public';
|
||||||
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
|
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
|
||||||
import { KibanaRootContextProvider } from '@kbn/react-kibana-context-root';
|
|
||||||
import { FeatureFlagsExampleApp } from './components/app';
|
import { FeatureFlagsExampleApp } from './components/app';
|
||||||
|
|
||||||
export const renderApp = (coreStart: CoreStart, { element }: AppMountParameters) => {
|
export const renderApp = (coreStart: CoreStart, { element }: AppMountParameters) => {
|
||||||
const { notifications, http, featureFlags } = coreStart;
|
const { notifications, http, featureFlags } = coreStart;
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<KibanaRootContextProvider {...coreStart}>
|
<KibanaRenderContextProvider {...coreStart}>
|
||||||
<KibanaPageTemplate>
|
<FeatureFlagsExampleApp
|
||||||
<FeatureFlagsExampleApp
|
featureFlags={featureFlags}
|
||||||
featureFlags={featureFlags}
|
notifications={notifications}
|
||||||
notifications={notifications}
|
http={http}
|
||||||
http={http}
|
/>
|
||||||
/>
|
</KibanaRenderContextProvider>,
|
||||||
</KibanaPageTemplate>
|
|
||||||
</KibanaRootContextProvider>,
|
|
||||||
element
|
element
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,7 @@ export const FeatureFlagsExampleApp = ({ featureFlags }: FeatureFlagsExampleAppD
|
||||||
<h3>Rendered together</h3>
|
<h3>Rendered together</h3>
|
||||||
<p>
|
<p>
|
||||||
`useObservable` causes a full re-render of the component, updating the{' '}
|
`useObservable` causes a full re-render of the component, updating the{' '}
|
||||||
<i>statically</i>
|
<i>statically</i> evaluated flags as well.
|
||||||
evaluated flags as well.
|
|
||||||
</p>
|
</p>
|
||||||
<FeatureFlagsFullList featureFlags={featureFlags} />
|
<FeatureFlagsFullList featureFlags={featureFlags} />
|
||||||
</EuiText>
|
</EuiText>
|
||||||
|
|
|
@ -14,12 +14,11 @@
|
||||||
"exclude": ["target/**/*"],
|
"exclude": ["target/**/*"],
|
||||||
"kbn_references": [
|
"kbn_references": [
|
||||||
"@kbn/core",
|
"@kbn/core",
|
||||||
"@kbn/shared-ux-page-kibana-template",
|
|
||||||
"@kbn/react-kibana-context-root",
|
|
||||||
"@kbn/core-feature-flags-server",
|
"@kbn/core-feature-flags-server",
|
||||||
"@kbn/core-plugins-server",
|
"@kbn/core-plugins-server",
|
||||||
"@kbn/config-schema",
|
"@kbn/config-schema",
|
||||||
"@kbn/developer-examples-plugin",
|
"@kbn/developer-examples-plugin",
|
||||||
"@kbn/core-feature-flags-browser",
|
"@kbn/core-feature-flags-browser",
|
||||||
|
"@kbn/react-kibana-context-render",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue