Skip to content

Commit

Permalink
[Feature Flags Example Plugin] Change ctx provider (#201097)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Nov 21, 2024
1 parent 65cb53c commit f026208
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
19 changes: 8 additions & 11 deletions examples/feature_flags_example/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand Down
3 changes: 1 addition & 2 deletions examples/feature_flags_example/public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 1 addition & 2 deletions examples/feature_flags_example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
}

0 comments on commit f026208

Please sign in to comment.