@rabi_roshan/react-feature-flipper
Version:
Effortlessly manage feature flags in React. Simplify flag distribution and control across your application.
17 lines (16 loc) • 656 B
TypeScript
/**
* Custom hook for accessing the feature flags context.
*
* This hook simplifies the process of using feature flags in your React components
* by providing direct access to the flags and the associated setter function.
* It must be used within a component tree that has `FlagsProvider` at its root,
* as it relies on the context provided by `FlagsProvider`.
*
* @returns The `flags` state and the `setFlags` function from the context.
*
* @example
* const { flags, setFlags } = useFlags();
*
* @throws Will throw an error if used outside of a `FlagsProvider`.
*/
export declare const useFlags: () => import("./context").FlagsContextState;