WithFeatureToggle.tsx 282 B

12345678910111213
  1. import React, { FunctionComponent } from 'react';
  2. export interface Props {
  3. featureToggle: boolean;
  4. }
  5. export const WithFeatureToggle: FunctionComponent<Props> = ({ featureToggle, children }) => {
  6. if (featureToggle === true) {
  7. return <>{children}</>;
  8. }
  9. return null;
  10. };