/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the "Elastic License * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side * Public License v 1"; you may not use this file except in compliance with, at * your election, the "Elastic License 2.0", the "GNU Affero General Public * License v3.0 only", or the "Server Side Public License, v 1". */ import React from 'react'; import { EuiHorizontalRule, EuiPageTemplate, EuiTitle, EuiText, EuiLink } from '@elastic/eui'; import type { CoreStart, FeatureFlagsStart } from '@kbn/core/public'; import { PLUGIN_NAME } from '../../common'; import { FeatureFlagsFullList, FeatureFlagsReactiveList, FeatureFlagsStaticList, } from './feature_flags_list'; interface FeatureFlagsExampleAppDeps { featureFlags: FeatureFlagsStart; notifications: CoreStart['notifications']; http: CoreStart['http']; } export const FeatureFlagsExampleApp = ({ featureFlags }: FeatureFlagsExampleAppDeps) => { return ( <>

{PLUGIN_NAME}

Demo of the feature flags service

To learn more, refer to{' '} the docs .

Rendered separately

Each list are 2 different components, so only the reactive one is re-rendered when the feature flag is updated and the static one keeps the value until the next refresh.

Rendered together

`useObservable` causes a full re-render of the component, updating the{' '} statically evaluated flags as well.

); };