@atlaskit/flag
Version:
A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction, often displayed using a flag group.
13 lines • 463 B
JavaScript
import { useContext } from 'react';
import { FlagContext } from './flag-context';
/**
* useFlags is used to access the `showFlags` function which can be used to programmatically display flags.
* - [Examples](https://atlassian.design/components/flag/flags-provider/examples#using-showflags)
*/
export function useFlags() {
const api = useContext(FlagContext);
if (api == null) {
throw new Error('Unable to find FlagProviderContext');
}
return api;
}