FlagsterFlagster
SDKs/React/Components

Feature

Feature component allows you to render a component based on the flag value.

PropTypeDefault
name
string
-

This is useful when you want to render a component based on the flag value and want specific logic to be executed based on the flag value.

Usage

import { Feature } from 'flagster-react';
 
const MyComponent = () => {
  return (
    <Feature name="github_auth">
      (isEnabled) => <div>GitHub Auth is {isEnabled ? 'enabled' : 'disabled'}</div>
    </Feature>
  );
};

On this page