513 B24 lines
Blame
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8import {useFeatureFlagSync} from '../featureFlags';
9
10export default function GatedComponent({
11 featureFlag,
12 children,
13}: {
14 children: React.ReactNode;
15 featureFlag: string | undefined;
16}) {
17 const featureEnabled = useFeatureFlagSync(featureFlag);
18
19 if (!featureEnabled) {
20 return null;
21 }
22 return children;
23}
24