How to use the @flopflip/react-broadcast.useFeatureToggle function in @flopflip/react-broadcast

To help you get started, we’ve selected a few @flopflip/react-broadcast examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / merchant-center-application-kit / packages / application-shell / src / test-utils / test-utils.spec.js View on Github external
const TestComponent = () => {
    const isFeatureEnabled = useFeatureToggle(FEATURE_NAME);

    return <p>Enabled: {isFeatureEnabled ? 'Yes' : 'No'}</p>;
  };
  it('should not enable features toggles by default', async () =&gt; {
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / navbar / navbar.js View on Github external
export const NavBar = props => {
  const ref = React.useRef();
  const areProjectExtensionsEnabled = useFeatureToggle(PROJECT_EXTENSIONS);
  const disabledMenuItems = useApplicationContext(
    context => context.environment.disabledMenuItems
  );
  const menuVisibilities = useApplicationContext(
    context => context.menuVisibilities
  );
  const applicationsMenu = useApplicationsMenu({
    queryOptions: {
      onError: reportErrorToSentry,
    },
    skipRemoteQuery: !props.environment.servedByProxy,
    options: {
      __DEV_CONFIG__: {
        menuLoader: props.DEV_ONLY__loadNavbarMenuConfig,
        menuKey: 'navBar',
      },

@flopflip/react-broadcast

A feature toggle wrapper to use LaunchDarkly with React

MIT
Latest version published 16 days ago

Package Health Score

81 / 100
Full package analysis