Files
grafana/public/app/core/components/WithFeatureToggle.tsx

14 lines
282 B
TypeScript
Raw Normal View History

2019-03-08 10:46:52 +01:00
import React, { FunctionComponent } from 'react';
export interface Props {
featureToggle: boolean;
}
export const WithFeatureToggle: FunctionComponent<Props> = ({ featureToggle, children }) => {
if (featureToggle === true) {
return <>{children}</>;
}
return null;
};