mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
53354224fc
Upgrades biome to 1.6.1, and updates husky pre-commit hook. Most changes here are making type imports explicit.
11 lines
300 B
TypeScript
11 lines
300 B
TypeScript
import { useMemo } from 'react';
|
|
import { type Variant, getVariantValue } from 'utils/variants';
|
|
|
|
export const useVariant = <T = string>(variant?: Variant) => {
|
|
return useMemo(() => {
|
|
if (variant?.enabled) {
|
|
return getVariantValue<T>(variant);
|
|
}
|
|
}, [variant]);
|
|
};
|