Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const TestComponent = () => {
const isFeatureEnabled = useFeatureToggle(FEATURE_NAME);
return <p>Enabled: {isFeatureEnabled ? 'Yes' : 'No'}</p>;
};
it('should not enable features toggles by default', async () => {
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',
},